Skip to content

Commit 0c81294

Browse files
committed
added CI
1 parent 21e7c20 commit 0c81294

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+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
rustfmt:
10+
name: Check rustfmt
11+
runs-on: ubuntu-latest
12+
if: github.ref == 'refs/heads/main'
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- run: cargo fmt --all -- --check
17+
18+
compile_and_clippy:
19+
name: Compile and Clippy
20+
runs-on: ubuntu-latest
21+
if: github.ref == 'refs/heads/main'
22+
env:
23+
RUSTFLAGS: -D warnings
24+
RUSTDOCFLAGS: -D warnings
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
- uses: hecrj/setup-rust-action@v1
29+
with:
30+
components: clippy
31+
- name: Cache cargo directories
32+
uses: actions/cache@v2
33+
with:
34+
path: |
35+
~/.cargo/registry
36+
~/.cargo/git
37+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
40+
${{ runner.os }}-cargo-
41+
- name: Cache cargo target dirs
42+
uses: actions/cache@v2
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}
46+
restore-keys: |
47+
${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}
48+
${{ runner.os }}-target-lint-stable-
49+
${{ runner.os }}-target-lint-
50+
51+
- name: no features
52+
run: cargo clippy --all-targets

0 commit comments

Comments
 (0)