-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (67 loc) · 2.5 KB
/
ci.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
81
82
name: ci
on:
pull_request:
push:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1
with:
components: clippy
cache: false
- name: Cache rust build files
uses: Leafwing-Studios/cargo-cache@6c2a159aab4b3ba20f083d241bb1f26b35262b99 # v2
- name: check (release)
run: cargo check --workspace --all-targets --all-features --release
- name: clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings --force-warn deprecated --force-warn dead-code
## Tests
# Install sops (needed for decrypting tests .env file)
- name: Setup sops
uses: nhedger/setup-sops@358bac533e4e92f9ce9f9da563d6265929c88cda # v2
# Install age (needed for decrypting tests .env file)
- name: Setup age
uses: alessiodionisi/setup-age-action@82b9aea163ade7fe23441552a514cf666b214077 # v1.3.0
- name: unit-tests
uses: LNSD/sops-exec-action@6da1fbca63459d9796097496d5f5e6233555b31a # v1
env:
SOPS_AGE_KEY: ${{ secrets.IT_TESTS_AGE_KEY }}
with:
env_file: .env
run: cargo test --workspace --all-features --lib
- name: doc-tests
uses: LNSD/sops-exec-action@6da1fbca63459d9796097496d5f5e6233555b31a # v1
env:
SOPS_AGE_KEY: ${{ secrets.IT_TESTS_AGE_KEY }}
with:
env_file: .env
run: cargo test --workspace --all-features --doc
- name: integration-tests
uses: LNSD/sops-exec-action@6da1fbca63459d9796097496d5f5e6233555b31a # v1
env:
SOPS_AGE_KEY: ${{ secrets.IT_TESTS_AGE_KEY }}
with:
env_file: .env
run: cargo test --workspace --all-features --test '*'
format:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1
with:
toolchain: nightly
components: rustfmt
cache: false
- run: cargo +nightly fmt --all -- --check