forked from Phala-Network/phala-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (130 loc) · 4.01 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
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: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/setup-cache
with:
key: core
- uses: ./.github/actions/maximize-disk-space
- uses: ./.github/actions/build-core
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
build-pruntime:
name: Build pruntime
runs-on: ubuntu-20.04
steps:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/setup-cache
with:
key: pruntime
- uses: ./.github/actions/maximize-disk-space
- uses: ./.github/actions/build-pruntime
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
build-prouter:
name: Build prouter
runs-on: ubuntu-20.04
steps:
- 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:
- 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: 18
- name: Install yarn 2
run: sudo npm install -g yarn && yarn set version 3.6.4
- 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 3.6.4 && cd ./e2e/ && yarn && 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:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/install_toolchain
- uses: ./.github/actions/maximize-disk-space
- 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:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/install_toolchain
- name: Install clippy
run: rustup component add clippy
- uses: ./.github/actions/maximize-disk-space
- name: Run cargo clippy
run: cargo clippy --tests -- -D warnings && cd standalone/pruntime && cargo clippy --tests -- -D warnings