ci: add build, lint and release workflows #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract k6 version from go.mod | |
id: version | |
run: |- | |
k6version=$(grep -e go.k6.io go.mod | cut -d' ' -f 2) | |
echo "Detected k6 version: ${k6version}" | |
echo "k6=${k6version}" >> $GITHUB_OUTPUT | |
- name: Build with xk6 | |
run: |- | |
docker run --rm -i -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \ | |
grafana/xk6 build ${{ steps.version.outputs.k6 }} \ | |
--with sm=. | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
only-new-issues: true | |
args: --timeout=5m # 1m is not enough, experimentally. |