-
Notifications
You must be signed in to change notification settings - Fork 22
97 lines (91 loc) · 2.4 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
matrix-setup:
runs-on: ubuntu-latest
outputs:
os-matrix: ${{ steps.set-matrix.outputs.os-matrix }}
steps:
- id: set-matrix
run: |
echo 'os-matrix=["ubuntu-latest", "macos-latest"]' >> $GITHUB_OUTPUT
devrequirements:
needs: matrix-setup
strategy:
matrix:
os: ${{ fromJson(needs.matrix-setup.outputs.os-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make install-buf
verify-generated-code:
needs: matrix-setup
strategy:
matrix:
os: ${{ fromJson(needs.matrix-setup.outputs.os-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make install-buf
- run: make gen-proto
- name: Check for changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Generated code is not up to date. Please run 'make gen-proto' locally and commit the changes."
git status
git diff
exit 1
fi
coverage:
runs-on: ubuntu-latest # action go-test-coverage not available on macos
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make cover.out
- uses: vladopajic/go-test-coverage@v2
with:
config: .testcoverage.yml
short:
needs: matrix-setup
strategy:
matrix:
os: ${{ fromJson(needs.matrix-setup.outputs.os-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make test
e2e:
needs: matrix-setup
strategy:
matrix:
os: ${{ fromJson(needs.matrix-setup.outputs.os-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-logs-${{ matrix.os }}
path: e2e/artifacts/