forked from mirrors/kingfisher
Fixing CI builds for Windows on GitHub Actions
This commit is contained in:
parent
77bcbd6130
commit
133d59b367
5 changed files with 146 additions and 73 deletions
120
.github/workflows/ci.yml
vendored
120
.github/workflows/ci.yml
vendored
|
|
@ -1,9 +1,9 @@
|
|||
name: CI Pull Request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
RUST_TOOLCHAIN: "1.90"
|
||||
|
|
@ -12,36 +12,86 @@ env:
|
|||
# It builds the project for 2 platforms, Linux arm64 and macOS arm64,
|
||||
# and runs tests for each platform. All platforms tested on merge to main
|
||||
jobs:
|
||||
linux-arm64:
|
||||
name: Linux arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: swatinem/rust-cache@v2
|
||||
- name: Build (Makefile linux-arm64)
|
||||
run: make ubuntu-arm64
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
env:
|
||||
CARGO_BUILD_JOBS: 1
|
||||
linux-arm64:
|
||||
name: Linux arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: swatinem/rust-cache@v2
|
||||
- name: Build (Makefile linux-arm64)
|
||||
run: make ubuntu-arm64
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
env:
|
||||
CARGO_BUILD_JOBS: 1
|
||||
|
||||
macos-arm64:
|
||||
name: macOS arm64
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: swatinem/rust-cache@v2
|
||||
- name: Build (Makefile darwin-arm64)
|
||||
run: make darwin-arm64
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
macos-arm64:
|
||||
name: macOS arm64
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: swatinem/rust-cache@v2
|
||||
- name: Build (Makefile darwin-arm64)
|
||||
run: make darwin-arm64
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
|
||||
windows:
|
||||
name: Windows x64
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache vcpkg artifacts
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
C:\vcpkg\buildtrees
|
||||
C:\vcpkg\packages
|
||||
C:\vcpkg\installed
|
||||
C:\vcpkg\downloads
|
||||
C:\vcpkg\archives
|
||||
C:\Users\runneradmin\AppData\Local\vcpkg\archives
|
||||
key: ${{ runner.os }}-vcpkg-hyperscan
|
||||
restore-keys: |
|
||||
${{ runner.os }}-vcpkg-
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Build
|
||||
run: .\buildwin.bat
|
||||
shell: cmd
|
||||
|
||||
- name: Run tests
|
||||
shell: pwsh
|
||||
run: |
|
||||
if (-not (Get-Command cargo-nextest -ErrorAction SilentlyContinue)) {
|
||||
cargo install --locked cargo-nextest
|
||||
}
|
||||
Write-Host "▶ cargo nextest run --release --workspace --all-targets"
|
||||
cargo nextest run --release --workspace --all-targets
|
||||
|
||||
- name: Move artifact to dist
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p dist
|
||||
cp target/release/kingfisher-windows-x64.zip dist/
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: kingfisher-windows-x64
|
||||
path: dist/kingfisher-*windows-x64*.*
|
||||
|
|
|
|||
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
|
|
@ -198,13 +198,16 @@ jobs:
|
|||
C:\vcpkg\buildtrees
|
||||
C:\vcpkg\packages
|
||||
C:\vcpkg\installed
|
||||
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.cmake') }}
|
||||
C:\vcpkg\downloads
|
||||
C:\vcpkg\archives
|
||||
C:\Users\runneradmin\AppData\Local\vcpkg\archives
|
||||
key: ${{ runner.os }}-vcpkg-hyperscan
|
||||
restore-keys: |
|
||||
${{ runner.os }}-vcpkg-
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Build
|
||||
run: .\buildwin.bat -force
|
||||
run: .\buildwin.bat
|
||||
shell: cmd
|
||||
|
||||
- name: Run tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue