-
Notifications
You must be signed in to change notification settings - Fork 8
50 lines (48 loc) · 1.48 KB
/
pull-request.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
name: pull request
on:
pull_request:
# We require PRs to be up to date before merging so technically it is not needed run the rust job
# on main. However for the cache to be usable in PRs we do need the job on main.
push:
branches: [main]
jobs:
lint:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
- run: |
rustup --version
rustup show
cargo --version
cargo +nightly fmt --version
cargo clippy --version
- run: cargo +nightly fmt --all -- --check
- run: cargo clippy --locked --workspace --all-features --all-targets -- -D warnings
unit-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
# Shrink artifact size by not including debug info. Makes build faster and shrinks cache.
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_PROFILE_TEST_DEBUG: 0
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- run: cargo build --tests
- run: cargo nextest run
openapi:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install @apidevtools/swagger-cli
- run: node_modules/.bin/swagger-cli validate openapi.yml