-
Notifications
You must be signed in to change notification settings - Fork 148
169 lines (164 loc) · 5.33 KB
/
build.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
name: Build and Test
on:
push:
branches: [ master ]
pull_request:
env:
CARGO_TERM_COLOR: always
YARN_ENABLE_IMMUTABLE_INSTALLS: false
jobs:
build-core:
name: Build core
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 1024
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/build-core
build-pruntime:
name: Build pruntime
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 1024
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/build-pruntime
build-prouter:
name: Build prouter
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 1024
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/build-prouter
build-contracts:
name: Build contracts
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/build-contracts
e2e-test:
name: Run E2E tests
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 1024
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/install_toolchain
- name: Install gramine
run: sudo bash dockerfile.d/01_apt_gramine.sh
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install yarn 2
run: sudo npm install -g yarn && yarn set version berry
- name: Download core-blockchain binaries
uses: actions/download-artifact@v3
with:
name: core-blockchain-binaries
path: ./target/release
- name: Download pruntime binaries
uses: actions/download-artifact@v3
with:
name: pruntime-binaries
path: ./standalone/pruntime/bin
- name: Download contract binaries
uses: actions/download-artifact@v3
with:
name: contract-binaries
path: ./e2e/res
- name: Build JS-SDK
run: cd ./frontend/packages/sdk && yarn && yarn build
- name: Change permission
run: chmod +x ./target/release/phala-node ./target/release/pherry ./standalone/pruntime/bin/pruntime
- name: Run E2E tests
run: yarn set version berry && cd ./e2e/ && yarn && yarn build:sdk && yarn build:proto && yarn test
- name: Pack logs if failed
if: failure()
run: tar czvf e2e-logs.tar.gz e2e
- name: Upload logs if failed
if: failure()
uses: actions/upload-artifact@v3
with:
name: e2e-logs
path: e2e-logs.tar.gz
needs: [ build-core, build-pruntime, build-contracts ]
cargo-tests:
name: Run cargo tests
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 1024
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/install_toolchain
- name: Run cargo tests
run: cargo test --tests --release --workspace --exclude node-executor --exclude phala-node
cargo-clippy:
name: Run cargo clippy
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 1024
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/install_toolchain
- name: Install clippy
run: rustup component add clippy
- name: Run cargo clippy
run: cargo clippy --tests -- -D warnings && cd standalone/pruntime && cargo clippy --tests -- -D warnings