Skip to content

Commit d92cc1b

Browse files
committed
ci: run tests in push-pr-release job
1 parent 950a505 commit d92cc1b

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/push-pr-release.yaml

+18-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build
33
on:
44
pull_request: {}
55
release:
6-
types: [ published ]
6+
types: [published]
77

88
# Needed to upload assets to releases.
99
permissions:
@@ -15,10 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
goos: [ linux, darwin ]
19-
goarch: [ amd64, arm64 ]
18+
goos: [linux, darwin]
19+
goarch: [amd64, arm64]
2020
steps:
2121
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
2223
- name: Extract k6 version from go.mod
2324
id: version
2425
run: |-
@@ -32,6 +33,20 @@ jobs:
3233
grafana/xk6 build ${{ steps.version.outputs.k6 }} \
3334
--output "dist/sm-k6-${{ matrix.goos }}-${{ matrix.goarch }}" \
3435
--with sm=.
36+
- name: Check runner architecture
37+
id: runner-info
38+
run: |-
39+
native="false" runner_arch="${{runner.arch}}" runner_os="${{runner.os}}" goos="${{matrix.goos}}" goarch="${{matrix.goarch}}"
40+
if [[ "${runner_arch/X/amd}" = "$goarch" ]] && [[ "${runner_os,,}" = "$goos" ]]; then
41+
native="true"
42+
fi
43+
echo "native=$native" >> $GITHUB_OUTPUT
44+
- name: Test
45+
# No point in running tests for foreign architectures we cannot run.
46+
if: steps.runner-info.outputs.native == 'true'
47+
run: |-
48+
# TODO: Run also unit tests. They are currently broken and need fixing.
49+
go test ./integration/...
3550
3651
- name: Upload artifact to release
3752
if: github.event_name == 'release'

0 commit comments

Comments
 (0)