-
Notifications
You must be signed in to change notification settings - Fork 50
80 lines (61 loc) · 1.86 KB
/
rust-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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Rust tests
on:
workflow_dispatch:
push:
branches:
- "master"
- "rc"
- "hotfix-rc"
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
ci-pass:
name: CI is green
runs-on: ubuntu-latest
needs:
- test
- wasm
steps:
- run: exit 0
test:
name: ${{ matrix.os }} / ${{matrix.target || 'default' }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install rust
uses: dtolnay/rust-toolchain@439cf607258077187679211f12aa6f19af4a0af7 # stable
with:
toolchain: stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
- name: Test
run: cargo test --all-features
wasm:
name: WASM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install rust
uses: dtolnay/rust-toolchain@439cf607258077187679211f12aa6f19af4a0af7 # stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Cache cargo registry
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
- name: Check
run: cargo check -p bitwarden-wasm --target wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Wasm-pack test firefox
run: wasm-pack test --headless --firefox crates/bitwarden-wasm
- name: Wasm-pack test chrome
run: wasm-pack test --headless --chrome crates/bitwarden-wasm