-
Notifications
You must be signed in to change notification settings - Fork 4
205 lines (167 loc) Β· 5.64 KB
/
desmos-bindings.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Desmos Bindings
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
on:
pull_request:
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout ποΈ
uses: actions/checkout@v2
- name: Verify .rs or toml files π
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
**/**.toml
**/Cargo.lock
FILES: |
Cargo.lock
- name: Setup Rust β
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- name: Prepare rust cache ποΈ
if: env.GIT_DIFF
uses: Swatinem/rust-cache@v2
- name: Unit tests π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo unit-test --locked
env:
RUST_BACKTRACE: 1
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v2
- name: Verify .rs files π
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
- name: Setup Rust β
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Prepare rust cache ποΈ
if: env.GIT_DIFF
uses: Swatinem/rust-cache@v2
- name: Run cargo fmt β
if: env.GIT_DIFF
run: cargo fmt --all -- --check
- name: Run cargo clippy β
if: env.GIT_DIFF
run: cargo clippy
build:
name: Test features build
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v2
- name: Verify .rs and toml files π
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
**/**.toml
- name: Setup Rust β
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Prepare rust cache π
if: env.GIT_DIFF
uses: Swatinem/rust-cache@v2
- name: Install wasm32-unknown-unknown target β
run: rustup target add wasm32-unknown-unknown
- name: Build No features π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --target wasm32-unknown-unknown
- name: Build feature (profiles) π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --features profiles --target wasm32-unknown-unknown
- name: Build feature (subspaces) π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --features subspaces --target wasm32-unknown-unknown
- name: Build feature (relationships) π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --features relationships --target wasm32-unknown-unknown
- name: Build feature (posts) π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --features posts --target wasm32-unknown-unknown
- name: Build feature (reactions) π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --features reactions --target wasm32-unknown-unknown
- name: Build feature (reports) π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo build --no-default-features --features reports --target wasm32-unknown-unknown
- name: Build all feature π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: |
cargo build --all-features --target wasm32-unknown-unknown
check:
name: Check desmos-bindings build
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v2
- name: Verify .rs and toml files π
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
**/**.toml
- name: Setup Rust β
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Prepare rust cache π
if: env.GIT_DIFF
uses: Swatinem/rust-cache@v2
- name: Install wasm2wat β
run: |
wget https://github.com/WebAssembly/wabt/releases/download/1.0.32/wabt-1.0.32-ubuntu.tar.gz
tar -xzf wabt-1.0.32-ubuntu.tar.gz
sudo mv wabt-1.0.32/bin/wasm2wat .
- name: Install wasm32-unknown-unknown target β
run: rustup target add wasm32-unknown-unknown
- name: Build all feature π§ͺ
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: |
cargo build --all-features --target wasm32-unknown-unknown
- name: Check floating issue π
if: env.GIT_DIFF
run: |
./wasm2wat target/wasm32-unknown-unknown/debug/desmos_bindings.wasm > tmp.wat
./scripts/check_floating.sh tmp.wat