-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.9 KB
/
run-test.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
name: Unit test & Integration test
on:
pull_request:
paths-ignore: [ '*.md' ]
push:
branches: [ 'main' ]
env:
CARGO_TERM_COLOR: always
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'test-on-pr'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
- name: Test core
working-directory: core
run: |
cargo test
cargo test --features=blocking
cargo test --features=experimental
- name: Integration test
working-directory: tests
run: cargo test
run-tests-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'wasm-pack'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Run wasm-pack test for core(japanese-address-parser)
working-directory: core
run: wasm-pack test --firefox --headless
- name: Build check for wasm crate
working-directory: wasm
run: wasm-pack build --target web --scope toriyama
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install minimum supported version
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.75.0
- name: Basic build
run: cargo build --verbose
- name: Build docs
run: cargo doc --verbose