diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 8d37fe0..ff73fe7 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -11,16 +11,16 @@ concurrency: jobs: build-nix-flake: - name: Build Nix flake (${{ matrix.platform.system }}) + name: Build Nix flake (${{ matrix.system }}) strategy: fail-fast: false matrix: - platform: + include: - runner: ubuntu-24.04 system: x86_64-linux - runner: ubuntu-24.04-arm system: aarch64-linux - runs-on: ${{ matrix.platform.runner }} + runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: @@ -31,7 +31,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable github_access_token: ${{ secrets.GITHUB_TOKEN }} extra_nix_config: | - system = ${{ matrix.platform.system }} + system = ${{ matrix.system }} - name: Install cachix run: | nix-env -iA cachix -f https://cachix.org/api/v1/install @@ -41,6 +41,7 @@ jobs: run: | cachix use ${CACHIX_NAME} - name: Run checks + if: matrix.system == 'x86_64-linux' run: | nix flake check - name: Build and push to Cachix diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04da46d..4d4dbd3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,15 +43,15 @@ jobs: strategy: fail-fast: false matrix: - platform: + include: - runner: macos-15-intel target: x86_64-apple-darwin key: macos-amd64 - runner: macos-15 target: aarch64-apple-darwin key: macos-arm64 - name: Build for ${{ matrix.platform.key }} - runs-on: ${{ matrix.platform.runner }} + name: Build for ${{ matrix.key }} + runs-on: ${{ matrix.runner }} steps: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 @@ -61,31 +61,31 @@ jobs: run: | rustup toolchain install ${RUST_VERSION} rustup override set ${RUST_VERSION} - rustup target add ${{ matrix.platform.target }} + rustup target add ${{ matrix.target }} - name: Install lld run: | brew install lld - name: Build run: | - cargo build --release --locked --target ${{ matrix.platform.target }} + cargo build --release --locked --target ${{ matrix.target }} mkdir dist - cp target/${{ matrix.platform.target }}/release/sandhole dist/sandhole-${{ matrix.platform.key }} + cp target/${{ matrix.target }}/release/sandhole dist/sandhole-${{ matrix.key }} - name: Upload artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: - name: sandhole-${{ matrix.platform.key }} + name: sandhole-${{ matrix.key }} path: dist build-windows: strategy: fail-fast: false matrix: - platform: + include: - runner: windows-latest target: x86_64-pc-windows-msvc key: windows-amd64 - name: Build for ${{ matrix.platform.key }} - runs-on: ${{ matrix.platform.runner }} + name: Build for ${{ matrix.key }} + runs-on: ${{ matrix.runner }} steps: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 @@ -95,17 +95,17 @@ jobs: run: | rustup toolchain install ${RUST_VERSION} rustup override set ${RUST_VERSION} - rustup target add ${{ matrix.platform.target }} + rustup target add ${{ matrix.target }} - name: Build shell: bash run: | - cargo build --release --locked --target ${{ matrix.platform.target }} + cargo build --release --locked --target ${{ matrix.target }} mkdir dist - cp target/${{ matrix.platform.target }}/release/sandhole.exe dist/sandhole-${{ matrix.platform.key }}.exe + cp target/${{ matrix.target }}/release/sandhole.exe dist/sandhole-${{ matrix.key }}.exe - name: Upload artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: - name: sandhole-${{ matrix.platform.key }} + name: sandhole-${{ matrix.key }} path: dist create-release-draft: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 36e6960..2ba58f9 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -76,11 +76,11 @@ jobs: run: | cargo build --locked --no-default-features tests-nightly: - name: Run tests on nightly (${{ matrix.platform.runner }}) + name: Run tests on nightly (${{ matrix.runner }}) strategy: fail-fast: false matrix: - platform: + include: - runner: ubuntu-24.04-arm target: aarch64-unknown-linux-gnu - runner: macos-15-intel @@ -89,7 +89,7 @@ jobs: target: aarch64-apple-darwin - runner: windows-latest target: x86_64-pc-windows-msvc - runs-on: ${{ matrix.platform.runner }} + runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: @@ -100,10 +100,10 @@ jobs: tool: cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }} - name: Fetch nightly Rust run: | - rustup toolchain install nightly-${{ matrix.platform.target }} - rustup override set nightly-${{ matrix.platform.target }} + rustup toolchain install nightly-${{ matrix.target }} + rustup override set nightly-${{ matrix.target }} - name: Install lld on macOS - if: matrix.platform.target == 'x86_64-apple-darwin' || matrix.platform.target == 'aarch64-apple-darwin' + if: matrix.target == 'x86_64-apple-darwin' || matrix.target == 'aarch64-apple-darwin' run: | brew install lld - name: Test