-
-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (78 loc) · 2.26 KB
/
Copy pathci.yml
File metadata and controls
84 lines (78 loc) · 2.26 KB
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
on:
pull_request:
paths:
- "src/**"
- "stationapi/**"
- "preprocessor/**"
- "data_validator/**"
- "build.rs"
- "Cargo.lock"
- "Cargo.toml"
- "!*.csv"
push:
paths:
- "src/**"
- "stationapi/**"
- "preprocessor/**"
- "data_validator/**"
- "build.rs"
- "Cargo.lock"
- "Cargo.toml"
- "!*.csv"
name: Continuous integration
# stationapi-worker は wasm32 専用の crate なので、ネイティブ側とは別に検査する。
# ネイティブ向けのビルドも通るが、動かせるのは Workers 上だけ。
env:
NATIVE_PACKAGES: "-p stationapi -p stationapi-preprocessor -p data_validator"
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup target add wasm32-unknown-unknown
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: check-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- run: cargo check $NATIVE_PACKAGES
- run: cargo check --target wasm32-unknown-unknown -p stationapi-worker
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: test-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- run: cargo test $NATIVE_PACKAGES
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup component add clippy
- run: rustup target add wasm32-unknown-unknown
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: clippy-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- run: cargo clippy $NATIVE_PACKAGES --all-targets -- -D warnings
- run: cargo clippy --target wasm32-unknown-unknown -p stationapi-worker --all-targets -- -D warnings