-
Notifications
You must be signed in to change notification settings - Fork 30
87 lines (67 loc) · 2.33 KB
/
rust.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
name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
# With no feature. Target: normal & wasm & wasm-bindgen
- name: Build
run: cargo build --verbose
- name: Build in wasm
run: cargo build --verbose --target wasm32-unknown-unknown
- name: Build in wasm-bindgen
run: cargo build --verbose -F wasm-bindgen --target wasm32-unknown-unknown
# With feature `svg`. Target: normal & wasm & wasm-bindgen
- name: Build with `svg`
run: cargo build --verbose -F svg
- name: Build with `svg` in wasm
run: cargo build --verbose -F svg --target wasm32-unknown-unknown
- name: Build with `svg` in wasm-bindgen
run: cargo build --verbose -F svg,wasm-bindgen --target wasm32-unknown-unknown
# With feature `image`. Target: normal & wasm only
- name: Build with `image`
run: cargo build --verbose -F image
- name: Build with `image` in wasm
run: cargo build --verbose -F image --target wasm32-unknown-unknown
# With feature `wasm-bindgen`. Target: wasm only
- name: Build with `wasm-bindgen`
run: cargo build --verbose -F wasm-bindgen --target wasm32-unknown-unknown
# Benchmarks
- name: Build benchmarks
run: cargo build --benches
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
# Examples
- name: Build examples
run: |
for example in examples/*.rs; do
cargo run --example "$(basename "${example%.rs}")" -Fsvg,image
cargo build --example "$(basename "${example%.rs}")" -Fsvg,image --target wasm32-unknown-unknown
done
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Tests
- name: Run tests
run: cargo test --verbose -F svg,image
meta:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Typos
- name: typos-action
uses: crate-ci/typos@v1.0.4