-
Notifications
You must be signed in to change notification settings - Fork 4
124 lines (105 loc) · 4 KB
/
go-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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Go E2E tests
on:
pull_request:
jobs:
go-test:
runs-on: ubuntu-latest
name: Go test ${{matrix.name}}
container:
image: tokamaknetwork/thanos-ci-builder:latest
strategy:
matrix:
include:
- name: 'op-heartbeat-tests'
module: 'op-heartbeat'
- name: 'op-batcher-tests'
module: 'op-batcher'
- name: 'op-bindings-tests'
module: 'op-bindings'
- name: 'op-chain-ops-tests'
module: 'op-chain-ops'
- name: 'op-node-tests'
module: 'op-node'
- name: 'op-proposer-tests'
module: 'op-proposer'
- name: 'op-dispute-mon-tests'
module: 'op-challenger'
- name: 'op-conductor-tests'
module: 'op-conductor'
- name: 'op-program-tests'
module: 'op-program'
- name: 'op-service-tests'
module: 'op-service'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Prep results dir
run: mkdir -p /tmp/test-results
- name: Run tests
run: |
gotestsum --format=standard-verbose --junitfile=/tmp/test-results/${{ matrix.module }}.xml \
-- -parallel=8 -coverprofile=coverage.out ./...
working-directory: ${{ matrix.module }}
- name: Store test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.module }}
path: /tmp/test-results
cannon-go-lint-and-test:
runs-on: ubuntu-latest
container:
image: tokamaknetwork/thanos-ci-builder:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install Gotestsum
run: go install gotest.tools/[email protected]
- name: Check if changes affect relevant paths
id: changes-check
uses: dorny/paths-filter@v3
with:
filters: |
cannon:
- 'cannon/**'
contracts-bedrock:
- 'packages/tokamak/contracts-bedrock/src/cannon/**'
op-preimage:
- 'op-preimage/**'
- name: Prep Cannon results dir
run: mkdir -p /tmp/test-results
- name: Make Allocs
run: make devnet-allocs
- name: Build Cannon example binaries
run: make elf
working-directory: cannon/example
if: steps.changes-check.outputs.cannon == 'true' || steps.changes-check.outputs.contracts-bedrock == 'true' || steps.changes-check.outputs.op-preimage == 'true'
- name: Cannon Go lint
run: make lint
working-directory: cannon
if: steps.changes-check.outputs.cannon == 'true' || steps.changes-check.outputs.contracts-bedrock == 'true' || steps.changes-check.outputs.op-preimage == 'true'
- name: Cannon Go tests
run: |
gotestsum --format=standard-verbose --junitfile=/tmp/test-results/cannon.xml \
-- -parallel=2 -coverpkg=github.com/tokamak-network/thanos/cannon/... -coverprofile=coverage.out ./...
working-directory: cannon
if: steps.changes-check.outputs.cannon == 'true' || steps.changes-check.outputs.contracts-bedrock == 'true' || steps.changes-check.outputs.op-preimage == 'true'
- name: Upload Cannon coverage
run: codecov --verbose --clean --flags cannon-go-tests
if: steps.changes-check.outputs.cannon == 'true' || steps.changes-check.outputs.contracts-bedrock == 'true' || steps.changes-check.outputs.op-preimage == 'true'
- name: Store test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-lint
path: /tmp/test-results