Skip to content

Commit 71fbaa9

Browse files
committed
fix(ci): skip binary test for cross-compiled builds
The build job runs on ubuntu-latest (linux/amd64) but builds for multiple OS/arch combinations. Cross-compiled binaries cannot be executed on the runner, causing 'Exec format error'. - Only test binary when target matches runner (linux/amd64) - Add artifact upload for all built binaries
1 parent 615d73a commit 71fbaa9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ jobs:
115115
run: task build
116116

117117
- name: Test binary
118-
if: matrix.os != 'windows'
118+
# Only test binary when it matches the runner (ubuntu-latest = linux/amd64)
119+
# Cross-compiled binaries cannot be executed on different platforms
120+
if: matrix.os == 'linux' && matrix.arch == 'amd64'
119121
run: ./bin/1ctl --version
120122

121-
- name: Test binary (Windows)
122-
if: matrix.os == 'windows'
123-
run: ./bin/1ctl.exe --version
123+
- name: Upload artifact
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: 1ctl-${{ matrix.os }}-${{ matrix.arch }}
127+
path: bin/1ctl${{ matrix.os == 'windows' && '.exe' || '' }}
128+
retention-days: 7

0 commit comments

Comments
 (0)