Skip to content

Commit 2031fd9

Browse files
committed
ci: Add GitHub Actions configuration file for Rust build
1 parent 4c13376 commit 2031fd9

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/rust.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
rustfmt:
13+
name: 🗊 Formatting
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Install toolchain
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
profile: minimal
21+
toolchain: nightly
22+
override: true
23+
components: rustfmt
24+
- name: Run cargo fmt
25+
uses: actions-rs/cargo@v1
26+
with:
27+
command: fmt
28+
args: --all -- --check
29+
30+
lint:
31+
name: 🚨 Lint
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Install packages
36+
run: sudo apt-get install xorg-dev libglu1-mesa-dev
37+
- name: Install toolchain
38+
uses: actions-rs/toolchain@v1
39+
with:
40+
toolchain: stable
41+
override: true
42+
components: clippy
43+
- uses: actions-rs/clippy-check@v1
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
args: --all-features --all-targets -- -D warnings
47+
48+
test:
49+
name: ✅ Test Suite
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
- name: Install packages
54+
run: sudo apt-get install xorg-dev libglu1-mesa-dev
55+
- uses: actions-rs/toolchain@v1
56+
with:
57+
toolchain: stable
58+
override: true
59+
- uses: Swatinem/rust-cache@v1
60+
- name: Install cargo-nextest
61+
uses: baptiste0928/cargo-install@v1
62+
with:
63+
crate: cargo-nextest
64+
locked: true
65+
- uses: actions-rs/cargo@v1
66+
with:
67+
command: nextest
68+
args: run --retries 5 --workspace --failure-output final
69+
70+
security_audit:
71+
name: 👮 Audit
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v2
75+
- name: Cache cargo bin
76+
uses: actions/cache@v1
77+
with:
78+
path: ~/.cargo/bin
79+
key: ${{ runner.os }}-cargo-audit
80+
- uses: actions-rs/audit-check@v1
81+
with:
82+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)