Skip to content

Commit 4562a09

Browse files
authored
Separate CI jobs (#357)
1 parent 9aff0bc commit 4562a09

File tree

1 file changed

+54
-8
lines changed

1 file changed

+54
-8
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,73 @@ env:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
toolchain: [stable, nightly]
1821
steps:
1922
- uses: actions/checkout@v2
2023

2124
- uses: actions-rs/toolchain@v1
2225
with:
23-
toolchain: stable
26+
toolchain: ${{ matrix.toolchain }}
2427
override: true
2528

26-
- uses: actions-rs/toolchain@v1
29+
- uses: actions/cache@v2
2730
with:
28-
toolchain: nightly
29-
components: rustfmt, clippy
31+
path: |
32+
target
33+
key: ${{ runner.os }}-cargo-check-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
3034

3135
- name: Install alsa
32-
run: sudo apt-get install libasound2-dev
36+
run: sudo apt-get install --no-install-recommends libasound2-dev
3337

3438
- name: Build
3539
run: cargo check
40+
env:
41+
CARGO_INCREMENTAL: 0
42+
RUSTFLAGS: "-C debuginfo=0 -D warnings"
43+
44+
test:
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
toolchain: [stable, nightly]
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- uses: actions-rs/toolchain@v1
53+
with:
54+
toolchain: ${{ matrix.toolchain }}
55+
override: true
56+
57+
- uses: actions/cache@v2
58+
with:
59+
path: |
60+
target
61+
key: ${{ runner.os }}-cargo-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
62+
63+
- name: Install alsa
64+
run: sudo apt-get install --no-install-recommends libasound2-dev
65+
66+
- name: Run tests
67+
run: cargo test --workspace
68+
env:
69+
CARGO_INCREMENTAL: 0
70+
RUSTFLAGS: "-C debuginfo=0 -D warnings"
71+
72+
clean:
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v2
76+
77+
- uses: actions-rs/toolchain@v1
78+
with:
79+
toolchain: nightly
80+
components: rustfmt, clippy
81+
override: true
82+
83+
- name: Install alsa
84+
run: sudo apt-get install --no-install-recommends libasound2-dev
3685

3786
- name: Check the format
3887
run: cargo +nightly fmt --all -- --check
@@ -46,6 +95,3 @@ jobs:
4695
--
4796
-D warnings
4897
-A clippy::type_complexity
49-
50-
- name: Run tests
51-
run: cargo test --workspace

0 commit comments

Comments
 (0)