Skip to content

Commit 7673f05

Browse files
committed
ci: add build and lint workflows
1 parent ebd92c0 commit 7673f05

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/push-pr.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Push/PR
2+
3+
on:
4+
pull_request: {}
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
goos: [ linux ]
16+
goarch: [ amd64, arm64 ]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Extract k6 version from go.mod
20+
id: version
21+
run: |-
22+
k6version=$(grep -e go.k6.io go.mod | cut -d' ' -f 2)
23+
echo "Detected k6 version: ${k6version}"
24+
echo "k6=${k6version}" >> $GITHUB_OUTPUT
25+
- name: Build with xk6
26+
run: |-
27+
docker run --rm -i -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \
28+
-e "GOOS=${{ matrix.goos }}" -e "GOARCH=${{ matrix.goarch }}" \
29+
grafana/xk6 build ${{ steps.version.outputs.k6 }} \
30+
--output "dist/sm-k6-${{ matrix.goos }}-${{ matrix.goarch }}"
31+
--with sm=. \
32+
33+
golangci:
34+
name: Lint
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: golangci-lint
39+
uses: golangci/golangci-lint-action@v6
40+
with:
41+
only-new-issues: true
42+
args: --timeout=5m # 1m is not enough, experimentally.

0 commit comments

Comments
 (0)