Skip to content

Commit 1e0b8d5

Browse files
committed
Add CI checks as github actions
On PRs, run * Check formatting * Check clippy lints * Build everything * Run tests
1 parent c2d0133 commit 1e0b8d5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Numtracker CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dtolnay/rust-toolchain@stable
17+
with:
18+
toolchain: nightly
19+
components: rustfmt, clippy
20+
- uses: Swatinem/rust-cache@v2
21+
- name: Check formatting
22+
run: cargo +nightly fmt -- --check
23+
- name: Clippy
24+
run: |
25+
cargo --version
26+
cargo clippy --version
27+
cargo clippy --all-targets --all-features -- --deny warnings
28+
29+
test:
30+
runs-on: ubuntu-latest
31+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: dtolnay/rust-toolchain@stable
35+
with:
36+
toolchain: stable
37+
- uses: Swatinem/rust-cache@v2
38+
39+
- name: Build Everything
40+
run: cargo build --all-targets
41+
- name: Run tests
42+
run: cargo test --all-targets --verbose

0 commit comments

Comments
 (0)