-
Notifications
You must be signed in to change notification settings - Fork 18
207 lines (197 loc) · 7.34 KB
/
ci.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: Alicenet CI
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
node-unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
include:
- test-group: "[0-9a-dA-D]"
- test-group: "[eE]"
sub-filter-exclude: "ethdkg/phases"
- test-group: "ethdkg"
sub-filter-include: "phases"
sub-filter-exclude: "accusations"
- test-group: "ethdkg"
sub-filter-include: "phases/accusations"
- test-group: "[f-qF-Q]"
- test-group: "[r-sR-S]"
- test-group: "[t-zT-Z]"
defaults:
run:
working-directory: ./bridge
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "bridge/.nvmrc"
cache: "npm"
cache-dependency-path: bridge/package-lock.json
- run: npm ci
- run: npm run clean
- run: npm run compile
- uses: ./.github/actions/solidity-tests
with:
test-group: ${{ matrix.test-group }}
sub-filter-include: ${{ matrix.sub-filter-include }}
sub-filter-exclude: ${{ matrix.sub-filter-exclude }}
node-coverage:
runs-on: ubuntu-latest
timeout-minutes: 60
defaults:
run:
working-directory: ./bridge
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "bridge/.nvmrc"
cache: "npm"
cache-dependency-path: bridge/package-lock.json
- run: npm ci
- run: npm run clean
- run: npm run compile
- run: npx hardhat coverage --solcoverjs ./.solcover.ts
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- uses: codecov/codecov-action@v3
with:
files: ./bridge/coverage.json
verbose: true
node-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ./bridge
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "bridge/.nvmrc"
cache: "npm"
cache-dependency-path: bridge/package-lock.json
- run: npm ci
- run: npm run clean
- run: npm run compile
- run: npm run typechain
- run: npm run lint-solidity
- run: npm run lint
go-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: golangci/golangci-lint-action@v3
with:
version: v1.50.1
go-unit-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/alicenet-config
- run: go build ./...
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt
- name: Run unit tests
timeout-minutes: 20
run: |
set -euo pipefail
go test -race -json -covermode=atomic -coverpkg ./... -coverprofile=coverage.out ./... 2>&1 | tee /tmp/gotest.log | gotestfmt -hide all
- uses: codecov/codecov-action@v3
with:
files: ./coverage.out
verbose: true
go-integration-tests:
runs-on: ${{ matrix.os }}
needs: go-unit-tests
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
test-cmd: [
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestShareDistribution_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestShareDistribution_Group_2,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestShareDistribution_Group_3,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestRegisterTask_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestRegisterTask_Group_2,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestRegisterTask_Group_3,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestMPKSubmission_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestMPKSubmission_Group_2,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestKeyShareSubmission,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestGPKjSubmission_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestGPKjSubmission_Group_2,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestDisputeShareDistributionTask_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestDisputeMissingShareDistributionTask_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestDisputeMissingRegistrationTask_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestDisputeMissingKeySharesTask,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestDisputeMissingGPKjTask_Group_1,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestGPKjDispute,
# github.com/alicenet/alicenet/layer1/executor/tasks/dkg/tests -run TestCompletion_Group_1,
github.com/alicenet/alicenet/layer1/evm/tests,
github.com/alicenet/alicenet/layer1/chains/ethereum/tasks/dkg/state,
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "bridge/.nvmrc"
cache: "npm"
cache-dependency-path: bridge/package-lock.json
- run: npm --prefix bridge/ ci
- run: npm --prefix bridge/ run compile
- uses: ./.github/actions/alicenet-config
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt
- name: Run tests ${{ matrix.test-cmd }}
timeout-minutes: 45
env:
ENABLE_SCRIPT_LOG: "true"
run: |
set -euo pipefail
./scripts/main.sh init 5
go test -tags=integration -race -json -covermode=atomic -coverpkg ./... -coverprofile=coverage.out -timeout=30m ${{ matrix.test-cmd }} 2>&1 | tee /tmp/gotest.log | gotestfmt -hide all
- uses: codecov/codecov-action@v3
with:
files: ./coverage.out
verbose: true
goreleaser:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- uses: goreleaser/goreleaser-action@v4
with:
args: release --snapshot --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}