Skip to content

Commit 3a0a85c

Browse files
authored
Create CI jobs (#10)
* Create CI jobs * Add build job * Don't test all feature combinations * Enable all features * Build on different operating systems And with both stable and beta Rust * Correct matrix key
1 parent b1d2cfe commit 3a0a85c

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/rust.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
format:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: dtolnay/rust-toolchain@stable
22+
with:
23+
components: rustfmt
24+
- name: Format
25+
run: cargo fmt --check
26+
27+
check:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dtolnay/rust-toolchain@stable
32+
- name: Check
33+
run: cargo check
34+
35+
clippy:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: dtolnay/rust-toolchain@stable
40+
with:
41+
components: clippy
42+
- name: Run clippy
43+
run: cargo clippy --all-features -- -D warnings
44+
45+
build:
46+
strategy:
47+
matrix:
48+
os: [ubuntu-latest, macos-latest, windows-latest]
49+
toolchain: [stable, beta]
50+
runs-on: ${{ matrix.os }}
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: dtolnay/rust-toolchain@master
54+
with:
55+
toolchain: ${{ matrix.toolchain }}
56+
- name: Build
57+
run: cargo build --all-features
58+
59+
compile_benchmarks:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: dtolnay/rust-toolchain@stable
64+
- name: Compile benchmarks, but do not run them
65+
# There are no benchmarks with "nothing" in their name, hence this command only compiles the benchmarks but does not run them.
66+
run: cargo bench --all-features nothing

0 commit comments

Comments
 (0)