From 2ed4234cce2e88b4295d866581d8b24e308e6839 Mon Sep 17 00:00:00 2001 From: Julian Hofer Date: Mon, 9 Sep 2024 17:21:57 +0200 Subject: [PATCH] ci: Exclude instead of `if`, since `if` doesn't work with matrix --- .github/workflows/rust.yml | 12 ++++++++++-- .github/workflows/test_downstream.yml | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6e1ec93d1..8cc4c9ece 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -99,23 +99,31 @@ jobs: name: Cargo Test | ${{ matrix.name }} runs-on: ${{ matrix.os }} timeout-minutes: 60 - if: "${{ matrix.target != 'x86_64-apple-darwin' || (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') }}" strategy: fail-fast: false matrix: + main: "${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}" include: - { name: "Linux", target: x86_64-unknown-linux-musl, os: 8core_ubuntu_latest_runner, } - - { name: "macOS", target: x86_64-apple-darwin, os: macos-13 } + - { + name: "macOS", + target: x86_64-apple-darwin, + os: macos-13, + } - { name: "macOS-arm", target: aarch64-apple-darwin, os: macos-14 } - { name: "Windows", target: x86_64-pc-windows-msvc, os: 16core_windows_latest_runner, } + exclude: + - target: "x86_64-apple-darwin" + main: false + steps: - uses: actions/checkout@v4 - uses: taiki-e/setup-cross-toolchain-action@v1 diff --git a/.github/workflows/test_downstream.yml b/.github/workflows/test_downstream.yml index f87042ca1..e74e4e2be 100644 --- a/.github/workflows/test_downstream.yml +++ b/.github/workflows/test_downstream.yml @@ -7,7 +7,6 @@ jobs: # Install a couple of projects that we know use pixi test-downstream: name: ${{ matrix.arch.name }} - ${{ matrix.repository }} - if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }} runs-on: ${{ matrix.arch.os }} strategy: fail-fast: false