-
Notifications
You must be signed in to change notification settings - Fork 15
96 lines (77 loc) · 2.62 KB
/
run_test_suite.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
name: 🧪 Tests and Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# Smarter caching action, speeds up build times compared to regular cache:
# https://github.com/Swatinem/rust-cache
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-toolchain }}
components: clippy, rustfmt
- name: Check Format
run: cargo +${{ matrix.rust-toolchain }} fmt --all -- --check
- name: Run Linter
run: cargo +${{ matrix.rust-toolchain }} clippy --all -- -D warnings
- name: Install Cargo Audit
if: ${{ matrix.rust-toolchain == 'stable' }}
run: cargo install --force cargo-audit
- name: Run Audit on Deps
if: ${{ matrix.rust-toolchain == 'stable' }}
run: cargo-audit audit
# Only "test" release build on push event.
- name: Test Release
if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }}
run: cargo build --release
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Environment Packages
run: |
sudo apt-get update -qqy
sudo apt-get install jq
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-toolchain }}
- name: Run Tests
run: cargo test --all
- name: Install Rust/WASM Test Dependencies
run: |
rustup target install wasm32-unknown-unknown
cargo install toml-cli
WASM_BINDGEN_VERSION=`toml get ./Cargo.lock . | jq '.package | map(select(.name == "wasm-bindgen"))[0].version' | xargs echo`
cargo install wasm-bindgen-cli --vers "$WASM_BINDGEN_VERSION"
- name: Setup Chrome and Chromedriver
uses: nanasess/setup-chromedriver@v2
- name: Run Rust Headless Browser Tests
run: CHROMEDRIVER=/usr/local/bin/chromedriver cargo test --target wasm32-unknown-unknown