-
-
Notifications
You must be signed in to change notification settings - Fork 230
78 lines (76 loc) · 2.64 KB
/
regression.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
69
70
71
72
73
74
75
76
77
78
name: Regression Tests
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
jobs:
# Generate matrix of tags for all permutations of the tests
generate-matrix:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.generate.outputs.tags }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Generate tag combinations
id: generate
run: |
go run mage.go tagsmatrix > tags.json
echo "::set-output name=tags::$(cat tags.json)"
shell: bash
test:
needs: generate-matrix
strategy:
matrix:
go-version: [1.22.x, 1.23.x]
os: [ubuntu-latest]
build-flag: ${{ fromJson(needs.generate-matrix.outputs.tags) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Tests and coverage
run: |
export BUILD_TAGS=${{ matrix.build-flag }}
go run mage.go coverage
- name: "Codecov: General"
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5
if: ${{ matrix.go-version == '1.22.x' }}
with:
files: build/coverage.txt
flags: default,${{ matrix.build-flag }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: "Codecov: Examples"
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5
if: ${{ matrix.go-version == '1.22.x' }}
with:
files: build/coverage-examples.txt
flags: examples+${{ matrix.build-flag }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: "Codecov: FTW"
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5
if: ${{ matrix.go-version == '1.22.x' }}
with:
files: build/coverage-ftw.txt
flags: ftw,${{ matrix.build-flag }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: "Codecov: Tinygo"
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5
# only if coverage-tinygo.txt exists
if: ${{ matrix.go-version == '1.22.x' && hashFiles('build/coverage-tinygo.txt') != '' }}
with:
files: build/coverage-tinygo.txt
flags: tinygo,${{ matrix.build-flag }}
token: ${{ secrets.CODECOV_TOKEN }}