Skip to content

Commit 109332f

Browse files
Boshenanonrig
authored andcommitted
ci: setup ci
1 parent a6c4650 commit 109332f

File tree

4 files changed

+183
-1
lines changed

4 files changed

+183
-1
lines changed

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths-ignore:
7+
- '**/*.md'
8+
push:
9+
branches:
10+
- main
11+
paths-ignore:
12+
- '**/*.md'
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ github.ref_name != 'main' }}
17+
18+
jobs:
19+
check:
20+
name: Check
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- os: windows-latest
26+
- os: ubuntu-latest
27+
- os: macos-latest
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- uses: Swatinem/rust-cache@v2
33+
with:
34+
shared-key: ci
35+
save-if: ${{ github.ref_name == 'main' }}
36+
37+
- run: rustup show
38+
39+
- name: Cargo Check
40+
shell: bash
41+
run: |
42+
cargo check --all-targets --all-features --locked
43+
cargo test --no-run --all-targets --all-features
44+
45+
format:
46+
name: Format
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v3
50+
51+
- run: rustup show
52+
53+
- run: cargo fmt --all -- --check
54+
55+
lint:
56+
name: Clippy
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v3
60+
61+
- uses: Swatinem/rust-cache@v2
62+
with:
63+
shared-key: ci
64+
save-if: false
65+
66+
- run: rustup show
67+
68+
- run: cargo clippy -- -D warnings
69+
70+
test:
71+
name: Test
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
include:
76+
- os: windows-latest
77+
- os: ubuntu-latest
78+
- os: macos-latest
79+
runs-on: ${{ matrix.os }}
80+
steps:
81+
- uses: actions/checkout@v3
82+
83+
- uses: Swatinem/rust-cache@v2
84+
with:
85+
shared-key: ci
86+
save-if: false
87+
88+
- run: rustup show
89+
90+
- run: cargo test

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
/target
2-
/Cargo.lock

Cargo.lock

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "stable"
3+
profile = "default"

0 commit comments

Comments
 (0)