-
Notifications
You must be signed in to change notification settings - Fork 57
68 lines (60 loc) · 1.56 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Test
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Build
run: |
go version
pwd && ls -l
go install go.k6.io/xk6/cmd/xk6@latest
MODULE_NAME=$(go list -m)
xk6 build \
--output ./k6ext \
--with $MODULE_NAME="."
./k6ext version
- name: Test
if: ${{ github.ref_name == 'main' }}
run: go test -count 1 -coverprofile=coverage.txt ./...
- name: Upload Coverage
if: ${{ github.ref_name == 'main' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: grafana/xk6-sql
- name: Generate Go Report Card
if: ${{ github.ref_name == 'main' }}
uses: creekorful/goreportcard-action@v1.0
test:
strategy:
fail-fast: false
matrix:
go-version: [1.22.x, 1.21.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: |
which go
go version
go test -race -timeout 60s ./...