File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Build
3
3
on :
4
4
pull_request : {}
5
5
release :
6
- types : [ published ]
6
+ types : [published]
7
7
8
8
# Needed to upload assets to releases.
9
9
permissions :
@@ -15,10 +15,11 @@ jobs:
15
15
runs-on : ubuntu-latest
16
16
strategy :
17
17
matrix :
18
- goos : [ linux, darwin ]
19
- goarch : [ amd64, arm64 ]
18
+ goos : [linux, darwin]
19
+ goarch : [amd64, arm64]
20
20
steps :
21
21
- uses : actions/checkout@v4
22
+ - uses : actions/setup-go@v5
22
23
- name : Extract k6 version from go.mod
23
24
id : version
24
25
run : |-
32
33
grafana/xk6 build ${{ steps.version.outputs.k6 }} \
33
34
--output "dist/sm-k6-${{ matrix.goos }}-${{ matrix.goarch }}" \
34
35
--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/...
35
50
36
51
- name : Upload artifact to release
37
52
if : github.event_name == 'release'
You can’t perform that action at this time.
0 commit comments