Skip to content

Commit 85c8456

Browse files
authored
Merge pull request #3 from thunderbird/ikey/ci
Add GitHub CI workflow
2 parents 6bf8e48 + 08866d1 commit 85c8456

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '30 2 * * *'
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
name: Build & Test Project
18+
19+
steps:
20+
- name: Checkout source
21+
uses: actions/checkout@v4
22+
23+
- name: Install Rust
24+
uses: dtolnay/rust-toolchain@stable
25+
with:
26+
components: rustfmt, clippy
27+
28+
- name: Check Formatting
29+
run: cargo fmt --all -- --check
30+
31+
- name: Cargo Cache
32+
uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.cargo/registry/index/
36+
~/.cargo/registry/cache/
37+
target/
38+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
39+
40+
- name: Build project
41+
run: cargo build
42+
43+
- name: Test project
44+
run: cargo test --all
45+
46+
- name: Run clippy
47+
uses: giraffate/clippy-action@v1
48+
with:
49+
reporter: 'github-pr-check'
50+
clippy_flags: --no-deps
51+
filter_mode: nofilter
52+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)