Skip to content

Commit 01d8f8d

Browse files
committed
fix(ci): matrix does not support if so skip the build via workarounds
1 parent 4d2f897 commit 01d8f8d

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/release-tamagotchi.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,43 +54,51 @@ jobs:
5454
matrix:
5555
include:
5656

57-
- if: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }}
58-
os: macos-15-intel
57+
- os: macos-15-intel
5958
artifact: darwin-x64
6059
target: x86_64-apple-darwin
6160
arch: x64
6261
builder-args: --macos --x64
62+
skip: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }}
6363

64-
- if: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }}
65-
os: macos-latest
64+
- os: macos-latest
6665
artifact: darwin-arm64
6766
target: aarch64-apple-darwin
6867
builder-args: --macos --arm64
6968
arch: arm64
69+
skip: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }}
7070

71-
- if: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }}
72-
os: ubuntu-latest
71+
- os: ubuntu-latest
7372
artifact: linux-x64
7473
target: x86_64-unknown-linux-gnu
7574
builder-args: --linux --x64
7675
arch: x64
76+
skip: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }}
7777

78-
- if: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }}
79-
os: ubuntu-24.04-arm
78+
- os: ubuntu-24.04-arm
8079
artifact: linux-arm64
8180
target: aarch64-unknown-linux-gnu
8281
builder-args: --linux --arm64
8382
arch: arm64
83+
skip: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }}
8484

85-
- if: ${{ inputs.platform == 'all' || inputs.platform == 'windows' }}
86-
os: windows-latest
85+
- os: windows-latest
8786
artifact: windows-x64-setup
8887
target: x86_64-pc-windows-msvc
8988
builder-args: --windows --x64
9089
arch: x64
90+
skip: ${{ inputs.platform == 'all' || inputs.platform == 'windows' }}
9191

9292
runs-on: ${{ matrix.os }}
9393
steps:
94+
- name: Skip the build (fail fast)
95+
if: matrix.skip
96+
run: |
97+
echo "Skipping build for ${{ matrix.os }}..."
98+
echo "This will fail the job, but don't panic—this is expected when not building for all."
99+
echo "This will be improved in the future."
100+
exit 1
101+
94102
# Why?
95103
#
96104
# failed to build archive at `/home/runner/work/airi/airi/target/x86_64-unknown-linux-gnu/release/deps/libapp_lib.rlib`:

0 commit comments

Comments
 (0)