forked from Consensys/quorum
-
Notifications
You must be signed in to change notification settings - Fork 6
166 lines (164 loc) · 5.73 KB
/
pr.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
name: Pull Request Check
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- .gitignore
env:
GO_VERSION: 1.19
jobs:
lint:
name: 'Code linters'
runs-on: ubuntu-20.04
steps:
- name: 'Setup Go ${{ env.GO_VERSION }}'
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
- name: 'Check out project files'
uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: false
- name: 'Prepare environment'
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: 'Run code linters'
run: |
GO111MODULE=on make lint
unit-tests:
name: 'Unit tests in ${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
env:
QUORUM_IGNORE_TEST_PACKAGES: github.com/ethereum/go-ethereum/les,github.com/ethereum/go-ethereum/les/flowcontrol,github.com/ethereum/go-ethereum/mobile
runs-on: ${{ matrix.os }}
steps:
- name: 'Setup Go ${{ env.GO_VERSION }}'
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
- name: 'Check out project files'
uses: actions/checkout@v2
with:
submodules: recursive
- name: 'Prepare environment'
run: |
# https://github.com/actions/virtual-environments/issues/798
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: 'Run unit tests'
run: |
make test
docker-build:
name: 'Build Docker image'
runs-on: ubuntu-20.04
steps:
- name: 'Check out project files'
uses: actions/checkout@v2
- name: 'Build docker image'
id: build
run: |
output_dir=${{ runner.temp }}/docker
mkdir -p $output_dir
docker build -t quorumengineering/quorum:pr .
docker save quorumengineering/quorum:pr > quorum-pr.tar
tar cfvz $output_dir/quorum-pr.tar.gz quorum-pr.tar
echo "::set-output name=output_dir::$output_dir"
- name: 'Upload workflow artifact - Docker image'
uses: actions/upload-artifact@v2
with:
name: docker-image
path: ${{ steps.build.outputs.output_dir }}
peeps-tests:
name: Run PEEPS tests
needs:
- docker-build
runs-on: ubuntu-20.04
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Download workflow artifact - Docker image'
uses: actions/download-artifact@v1
with:
name: docker-image
- name: 'Load Docker image'
id: setup
run: |
tar xfvz docker-image/quorum-pr.tar.gz
docker load --input quorum-pr.tar
docker image tag quorumengineering/quorum:pr quorumengineering/quorum:develop
docker image ls
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
check-latest: true
- name: PEEPS
run: |
cd build
./run-peeps.sh
- name: PEEPS Test Report
uses: mikepenz/action-junit-report@v2
if: always()
with:
report_paths: '**/build/test-results/*/TEST-*.xml'
check_name: PEEPS test report
acceptance-tests:
name: Acceptance tests (${{ matrix.tag }})
needs:
- docker-build
if: success()
strategy:
fail-fast: false
matrix:
# list of tag expression being executed in parallel
# for PR, only selective tests are run.
# More comprehensive suites are scheduled to run in master
tag:
- 'basic || basic-raft || (advanced && raft) || networks/typical::raft'
- 'basic || basic-istanbul || (advanced && istanbul && !block-heights) || networks/typical::istanbul'
- 'basic || basic-istanbul || (advanced && istanbul && !block-heights) || empty-block-period || block-reward || networks/typical::qbft'
- 'validator-management && networks/template::istanbul-3plus1'
- 'validator-management && networks/template::qbft-3plus1'
- 'multitenancy && networks/plugins::raft-multitenancy'
- 'migration && networks/template::istanbul-4nodes'
- 'migration && networks/template::raft-4nodes'
- 'basic || networks/typical::raftmps'
- 'basic || networks/typical::istanbulmps'
- 'basic || networks/typical::qbftmps'
runs-on: ubuntu-20.04
steps:
- name: 'Download workflow artifact - Docker image'
uses: actions/download-artifact@v1
with:
name: docker-image
- name: 'Load Docker image'
id: setup
run: |
tar xfvz docker-image/quorum-pr.tar.gz
docker load --input quorum-pr.tar
docker_env_file="${{ runner.temp }}/env.list"
echo "TF_VAR_quorum_docker_image={ name = \"quorumengineering/quorum:pr\", local = true }" >> $docker_env_file
echo "::set-output name=outputDir::${{ runner.temp }}"
echo "::set-output name=dockerEnvFile::$docker_env_file"
- name: 'Run acceptance tests'
run: |
cat ${{ steps.setup.outputs.dockerEnvFile }}
docker run --rm \
--network host \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${{ steps.setup.outputs.outputDir }}:${{ steps.setup.outputs.outputDir }} \
--env-file ${{ steps.setup.outputs.dockerEnvFile }} \
quorumengineering/acctests:latest test \
-Pauto \
-Dauto.outputDir=${{ steps.setup.outputs.outputDir }} \
-Dtags="${{ matrix.tag }}"
- name: 'Debug'
run: |
docker images
docker ps -a