forked from phsym/xk6-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea1c075
commit 9985584
Showing
1 changed file
with
113 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: CI | ||
on: | ||
# Enable manually triggering this workflow via the API or web UI | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOLANG_CI_VERSION: v1.49.0 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
- name: golangci-lint on Go | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: ${{ env.GOLANG_CI_VERSION }} | ||
|
||
test-prev: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: [1.18.x] | ||
platform: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Run tests | ||
run: | | ||
go version | ||
go test -race -timeout 800s ./... | ||
test-current: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: [1.19.x] | ||
platform: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
check-latest: true | ||
- name: Run tests | ||
run: | | ||
go version | ||
go test -race -timeout 800s ./... | ||
test-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.x | ||
- name: Check build | ||
run: | | ||
go version | ||
pwd && ls -l | ||
go install go.k6.io/xk6/cmd/xk6@master | ||
GOPRIVATE="go.k6.io/k6" xk6 build \ | ||
--output ./k6ext \ | ||
--with github.com/knechtionscoding/xk6-prometheus="." | ||
./k6ext version | ||
test-tip: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.x | ||
- name: Install Go tip | ||
run: | | ||
go install golang.org/dl/gotip@latest | ||
gotip download | ||
echo "GOROOT=$HOME/sdk/gotip" >> "$GITHUB_ENV" | ||
echo "GOPATH=$HOME/go" >> "$GITHUB_ENV" | ||
echo "$HOME/go/bin" >> "$GITHUB_PATH" | ||
echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH" | ||
- name: Run tests | ||
run: | | ||
which go | ||
go version | ||
go test -race -timeout 800s ./... |