-
Notifications
You must be signed in to change notification settings - Fork 18
186 lines (141 loc) · 4.32 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
name: 'CI'
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
branches: [main]
workflow_dispatch:
env:
BINARYEN_VERSION: version_111
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install Node.js 20.x'
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 'Install dependencies'
run: yarn install
- name: 'Run linter'
run: yarn lint
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install Node.js 20.x'
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 'Install dependencies'
run: yarn install
- name: 'Build all packages'
run: yarn build:all
test-api:
runs-on: ubuntu-22.04
env:
RUSTUP_HOME: /tmp/rustup_home
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install: NodeJS 20.x'
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy, rustfmt, llvm-tools, rust-src
- name: 'Install: binaryen'
run: |
wget -c https://github.com/WebAssembly/binaryen/releases/download/$BINARYEN_VERSION/binaryen-$BINARYEN_VERSION-x86_64-linux.tar.gz -O - | tar -xz -C .
sudo cp binaryen-$BINARYEN_VERSION/bin/wasm-opt /usr/bin/
- name: 'Install dependencies'
run: yarn workspaces focus gear-js @gear-js/api
- name: 'Prepare: build programs'
run: cargo build --release
- name: 'Prepare: download Gear node'
run: |
wget -O ./gear https://github.com/gear-tech/gear/releases/download/build/gear
chmod +x gear
- name: 'Prepare: run Gear node'
run: |
nohup ./gear --dev --execution=wasm --tmp --unsafe-rpc-external --rpc-methods Unsafe --rpc-cors all &
- name: 'Prepare: sleep 3 min'
run: sleep 180
- name: 'Test: run'
run: yarn test:gear-api
check-gear-idea-version:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install: NodeJS 20.x'
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 'Install dependencies'
run: yarn workspaces focus gear-js
- name: 'Check'
run: yarn check:gear-idea-version
test-gear-idea-backend:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: Install NodeJS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 'Install dependencies'
run: yarn install
- name: 'Build'
run: |
yarn build:gear-api
yarn build:gear-idea-backend
- name: 'Run tests'
timeout-minutes: 3
run: yarn test:gear-idea-backend
test-ui:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: Install NodeJS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 'Install dependencies'
run: yarn install
- name: 'gear-ui: Run tests'
run: yarn test:ui
test-txwrapper:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install: NodeJS 20.x'
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 'Install dependencies'
run: yarn install
- name: 'Test: run'
run: yarn test:txwrapper