Skip to content

Commit 3208fea

Browse files
committed
Add CI
1 parent b3bfa55 commit 3208fea

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/pipeline.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Test & Audit
2+
3+
on:
4+
push:
5+
branches: [ "main", "ci-*" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Use rust nightly
18+
id: setup-rust
19+
uses: dtolnay/rust-toolchain@master
20+
with:
21+
toolchain: nightly
22+
components: rustfmt, clippy
23+
- name: Set up cargo cache
24+
uses: actions/cache@v3
25+
continue-on-error: false
26+
with:
27+
path: |
28+
~/.cargo/bin/
29+
~/.cargo/registry/index/
30+
~/.cargo/registry/cache/
31+
~/.cargo/git/db/
32+
target/
33+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ steps.setup-rust.outputs.cachekey }}
34+
restore-keys: ${{ runner.os }}-cargo-
35+
- name: Install cargo audit
36+
run: cargo install cargo-audit || true
37+
- name: Build
38+
run: cargo build --workspace --features strict --verbose
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
needs: build
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Use rust nightly
46+
id: setup-rust
47+
uses: dtolnay/rust-toolchain@master
48+
with:
49+
toolchain: nightly
50+
components: rustfmt, clippy
51+
- name: Set up cargo cache
52+
uses: actions/cache@v3
53+
continue-on-error: false
54+
with:
55+
path: |
56+
~/.cargo/bin/
57+
~/.cargo/registry/index/
58+
~/.cargo/registry/cache/
59+
~/.cargo/git/db/
60+
target/
61+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ steps.setup-rust.outputs.cachekey }}
62+
restore-keys: ${{ runner.os }}-cargo-
63+
- name: Run tests
64+
run: |
65+
cargo test --verbose --color=always
66+
67+
audit:
68+
runs-on: ubuntu-latest
69+
needs: build
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Use rust nightly
73+
id: setup-rust
74+
uses: dtolnay/rust-toolchain@master
75+
with:
76+
toolchain: nightly
77+
components: rustfmt, clippy
78+
- name: Set up cargo cache
79+
uses: actions/cache@v3
80+
continue-on-error: false
81+
with:
82+
path: |
83+
~/.cargo/bin/
84+
~/.cargo/registry/index/
85+
~/.cargo/registry/cache/
86+
~/.cargo/git/db/
87+
target/
88+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ steps.setup-rust.outputs.cachekey }}
89+
restore-keys: ${{ runner.os }}-cargo-
90+
- name: Install cargo audit
91+
run: cargo install cargo-audit || true
92+
- name: Cargo audit
93+
run: cargo audit
94+
- name: Cargo format check
95+
run: cargo fmt --check
96+
- uses: PurpleBooth/[email protected]
97+
name: Check markdown formatting
98+
- name: Cargo clippy
99+
run: cargo clippy
100+
101+

0 commit comments

Comments
 (0)