-
Notifications
You must be signed in to change notification settings - Fork 77
59 lines (51 loc) · 1.54 KB
/
test.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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13-large, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1
- name: Install wasm-pack and chromedriver
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
sudo apt-get install -y chromium-chromedriver
- name: Run Tests
shell: bash
run: |
# Test all features and no features for each package.
for p in $(cargo metadata --no-deps --format-version 1 | jq -r .packages[].manifest_path); do
pushd $(dirname $p)
cargo test --all-targets --all-features
cargo test --all-targets --no-default-features
popd
done
env:
RUST_BACKTRACE: 1
- name: Run Tests (WASM)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
CARGO_TARGET_DIR=target/wasm wasm-pack test --chrome --headless ic-agent --features wasm-bindgen
aggregate:
name: test:required
runs-on: ubuntu-latest
if: ${{ always() }}
needs: test
steps:
- name: Check test result
if: ${{ needs.test.result != 'success' }}
run: exit 1