-
Notifications
You must be signed in to change notification settings - Fork 7
207 lines (169 loc) · 5.57 KB
/
ci.yaml
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
---
name: CI
"on":
push:
branches:
- trunk
pull_request:
branches:
- trunk
schedule:
- cron: "0 0 * * TUE"
jobs:
build-rust:
name: Build Rust
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set toolchain versions
run: |
echo "emscripten=$(cat emscripten-toolchain)" >> $GITHUB_OUTPUT
id: toolchain_versions
- name: Install Rust toolchain
uses: artichoke/setup-rust/[email protected]
with:
toolchain: "1.69.0"
target: "wasm32-unknown-emscripten"
- name: Compile
run: cargo build --workspace --verbose
- name: Compile tests
run: cargo test --workspace --no-run
- name: Test
run: cargo test --workspace
build-webapp:
name: Build Webapp
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set toolchain versions
run: |
echo "emscripten=$(cat emscripten-toolchain)" >> $GITHUB_OUTPUT
id: toolchain_versions
- name: Install Node.js toolchain
uses: actions/[email protected]
with:
node-version: 18
# Must install deps before setting up emscripten toolchain since emsdk
# includes its own older node which does not support lockfileversion 3
# in package-lock.json.
- name: Install Node.js dependencies
run: npm ci
- name: Install Rust toolchain
uses: artichoke/setup-rust/[email protected]
with:
toolchain: "1.69.0"
target: "wasm32-unknown-emscripten"
- name: Install Ruby toolchain
uses: ruby/setup-ruby@52b8784594ec115fd17094752708121dc5dabb47 # v1.154.0
with:
ruby-version: ".ruby-version"
bundler-cache: true
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12
with:
version: ${{ steps.toolchain_versions.outputs.emscripten }}
no-cache: true
- name: Verify emcc version
run: emcc -v
- name: Compile Wasm
run: ruby scripts/build-wasm.rb --release --verbose
- name: Build Webapp
run: node build.mjs --release
rust:
name: Lint and format Rust
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set toolchain versions
run: |
echo "emscripten=$(cat emscripten-toolchain)" >> $GITHUB_OUTPUT
id: toolchain_versions
- name: Install Rust toolchain
uses: artichoke/setup-rust/[email protected]
with:
toolchain: "1.69.0"
- name: Install emscripten target
run: rustup target add wasm32-unknown-emscripten
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12
with:
version: ${{ steps.toolchain_versions.outputs.emscripten }}
- name: Verify emcc version
run: emcc -v
- name: Check formatting
run: cargo fmt --check
- name: Lint with Clippy
run: cargo clippy --workspace --all-features --all-targets
- name: Lint with Clippy on emscripten target
run: cargo clippy --workspace --all-features --all-targets --target wasm32-unknown-emscripten
ruby:
name: Lint and format Ruby
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install Ruby toolchain
uses: ruby/setup-ruby@52b8784594ec115fd17094752708121dc5dabb47 # v1.154.0
with:
ruby-version: ".ruby-version"
bundler-cache: true
- name: Lint and check formatting with Rubocop
run: bundle exec rubocop --format github
js-ts:
name: Lint and format JavaScript and TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install Node.js toolchain
uses: actions/[email protected]
with:
node-version: 18
- name: Install Nodejs toolchain
run: npm ci
- name: Create stubs for Wasm Sources
run: |
touch src/wasm/playground.js
touch src/wasm/playground.wasm
- name: Compile with TypeScript
run: npx tsc --extendedDiagnostics --listFiles --listEmittedFiles
- name: Lint with eslint
run: npm run lint
text:
name: Lint and format text
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install Node.js toolchain
uses: actions/[email protected]
with:
node-version: 18
- name: Install Nodejs toolchain
run: npm ci
- name: Lint and check formatting with prettier
run: npx prettier --check '**/*'
- name: Lint YAML sources with yamllint
run: |
yamllint --version
echo "Linting YAML sources with yamllint ..."
yamllint --strict --format github .
echo "OK"