-
Notifications
You must be signed in to change notification settings - Fork 3
28 lines (28 loc) · 918 Bytes
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: ['nightly', 'stable']
feat_multi_thread: ['', 'multi-thread']
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- name: Format
run: cargo fmt --check
- name: Set feat_toolchain
run: echo "feat_toolchain=$(if [ '${{ matrix.toolchain }}' = 'stable' ]; then printf 'stable'; fi)" >> "$GITHUB_ENV"
- name: Lint
run: cargo clippy --no-deps --no-default-features -F prg,${{ matrix.feat_multi_thread }},"$feat_toolchain" -- -Dwarnings
- name: Test
run: cargo test --no-default-features -F prg,${{ matrix.feat_multi_thread }},"$feat_toolchain"