Skip to content

Commit bc0f9e6

Browse files
infra: setup github CI
1 parent bbd64de commit bc0f9e6

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build (Linux)
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
os: [windows-latest, ubuntu-latest, macos-latest]
14+
runs-on: ${{ matrix.os }}
15+
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v4
19+
20+
- name: Install rust toolchain
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
- uses: Swatinem/rust-cache@v2
24+
with:
25+
shared-key: "build"
26+
27+
- name: Run cargo check
28+
run: cargo check
29+
30+
31+
lints:
32+
name: Lints
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout sources
36+
uses: actions/checkout@v4
37+
38+
- name: Install rust toolchain
39+
uses: dtolnay/rust-toolchain@stable
40+
with:
41+
components: rustfmt, clippy
42+
43+
- uses: Swatinem/rust-cache@v2
44+
with:
45+
shared-key: "build"
46+
47+
- name: Run cargo fmt
48+
run: cargo fmt --all --check
49+
50+
- name: Run cargo clippy
51+
run: cargo clippy --workspace --all-targets -- -D warnings
52+
53+
- name: Run cargo doc
54+
run: cargo doc --no-deps --workspace --document-private-items
55+
env:
56+
RUSTDOCFLAGS: -D warnings

0 commit comments

Comments
 (0)