-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (156 loc) · 4.75 KB
/
silkworm.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
name: EOS EVM Silkworm CI
on:
push:
branches:
- main
- release/*
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
documentation:
name: Attach Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'false'
- name: Attach Documentation
run: cat .github/workflows/siklworm.md >> $GITHUB_STEP_SUMMARY
d:
name: Discover Platforms
runs-on: ubuntu-latest
outputs:
missing-platforms: ${{steps.discover.outputs.missing-platforms}}
p: ${{steps.discover.outputs.platforms}}
steps:
- name: Discover Platforms
id: discover
uses: AntelopeIO/discover-platforms-action@v1
with:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builders
build-platforms:
name: Build Platforms
needs: d
if: needs.d.outputs.missing-platforms != '[]'
strategy:
fail-fast: false
matrix:
platform: ${{fromJSON(needs.d.outputs.missing-platforms)}}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}}
build:
name: EOS EVM Silkworm Build
needs: [d, build-platforms]
if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped')
strategy:
fail-fast: false
matrix:
platform: [ ubuntu22 ]
runs-on: ubuntu-latest
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
steps:
# - name: Authenticate
# id: auth
# uses: AntelopeIO/github-app-token-action@v1
# with:
# app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }}
# private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
token: ${{secrets.GITHUB_TOKEN}}
- name: Build EOS EVM Silkworm
run: .github/workflows/build-tests.sh
env:
CC: gcc-11
CXX: g++-11
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build.tar.gz
path: build.tar.gz
unit-test:
name: EOS EVM Silkworm Unit Tests
needs: [d, build]
if: always() && needs.d.result == 'success' && needs.build.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ ubuntu22 ]
runs-on: ubuntu-latest
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
env:
CC: gcc-11
CXX: g++-11
DCMAKE_BUILD_TYPE: 'Release'
steps:
- name: Update Package Index & Upgrade Packages
run: |
apt-get update
apt-get upgrade -y
apt update
apt upgrade -y
# - name: Authenticate
# id: auth
# uses: AntelopeIO/github-app-token-action@v1
# with:
# app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }}
# private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }}
- name: Download EOS EVM Silkworm builddir
uses: actions/download-artifact@v3
with:
name: build.tar.gz
- name: Extract EOS EVM Silkworm builddir
id: evm-silkworm-build
run: |
mkdir silkworm
mv build.tar.gz silkworm/
pushd silkworm
tar xvf build.tar.gz
pushd build
echo "EVM_SILKWORM_BUILD=$(pwd)" >> "$GITHUB_OUTPUT"
popd
- name: Test rpcdaemon_test
run: |
cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/
./rpcdaemon_test
- name: Test core_test
run: |
cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/
./core_test
- name: Test infra_test
run: |
cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/
./infra_test
- name: Test node_test
run: |
cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/
./node_test
- name: Test sync_test
run: |
cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/
./sync_test