forked from mirrors/kingfisher
161 lines
4.2 KiB
YAML
161 lines
4.2 KiB
YAML
name: CI Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
VCPKG_ROOT: C:\vcpkg
|
|
VCPKG_DOWNLOADS: C:\vcpkg\downloads
|
|
VCPKG_FEATURE_FLAGS: binarycaching
|
|
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
|
|
RUST_TOOLCHAIN: "1.92"
|
|
|
|
jobs:
|
|
linux-x64:
|
|
name: Linux x64
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Free up disk space on Ubuntu runners
|
|
- name: Free Disk Space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /usr/local/lib/android
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
|
sudo docker image prune --all --force
|
|
df -h
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
profile: minimal
|
|
override: true
|
|
|
|
- uses: swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: kingfisher-${{ runner.os }}-${{ runner.arch }}
|
|
cache-on-failure: true
|
|
|
|
- name: Build (Makefile linux-x64)
|
|
run: make ubuntu-x64
|
|
- 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
|
|
|
|
# Free up disk space on Ubuntu runners
|
|
- name: Free Disk Space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /usr/local/lib/android
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
|
sudo docker image prune --all --force
|
|
df -h
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
profile: minimal
|
|
override: true
|
|
|
|
- uses: swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: kingfisher-${{ runner.os }}-${{ runner.arch }}
|
|
cache-on-failure: true
|
|
|
|
- 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
|
|
with:
|
|
shared-key: kingfisher-${{ runner.os }}-${{ runner.arch }}
|
|
cache-on-failure: true
|
|
- name: Build (Makefile darwin-arm64)
|
|
run: make darwin-arm64
|
|
- name: Run tests
|
|
run: make tests
|
|
|
|
windows:
|
|
name: Windows ${{ matrix.arch }}
|
|
runs-on: ${{ matrix.runs_on }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x64
|
|
runs_on: windows-latest
|
|
msystem: MINGW64
|
|
- arch: arm64
|
|
runs_on: windows-11-arm
|
|
msystem: CLANGARM64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Set up MSYS2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: ${{ matrix.msystem }}
|
|
update: true
|
|
install: >-
|
|
make
|
|
git
|
|
|
|
- uses: swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: kingfisher-${{ runner.os }}-${{ runner.arch }}
|
|
cache-on-failure: true
|
|
|
|
- name: Build
|
|
shell: msys2 {0}
|
|
run: make windows-${{ matrix.arch }}
|
|
|
|
- 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-${{ matrix.arch }}.zip dist/
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: kingfisher-windows-${{ matrix.arch }}
|
|
path: dist/kingfisher-*windows-${{ matrix.arch }}*.*
|