Skip to content

Commit d543083

Browse files
authored
Merge pull request #27 from Turbo87/ci
Improve CI setup
2 parents dbcf417 + 6a85c1c commit d543083

File tree

1 file changed

+36
-23
lines changed

1 file changed

+36
-23
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,52 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- master
7+
- main
58
pull_request:
69

710
env:
811
# minimum supported rust version
912
MSRV: 1.46.0
1013

1114
jobs:
12-
backend:
13-
name: Backend
14-
runs-on: ubuntu-18.04
15-
16-
env:
17-
CARGO_INCREMENTAL: 0
18-
RUSTFLAGS: "-C debuginfo=0 -D warnings"
19-
15+
check:
16+
name: Check
17+
runs-on: ubuntu-latest
2018
steps:
2119
- uses: actions/checkout@v2
20+
- run: rustup override set ${{env.MSRV}}
21+
- uses: Swatinem/[email protected]
22+
- run: cargo check --workspace --all-targets
23+
env:
24+
RUSTFLAGS: "-D warnings"
2225

23-
- name: Install Rust v${{ env.MSRV }}
24-
run: |
25-
rustup default ${{ env.MSRV }}
26-
27-
- name: Install lint tools
28-
run: |
29-
rustup component add rustfmt
30-
rustup component add clippy
31-
26+
tests:
27+
name: Tests
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- run: rustup override set ${{env.MSRV}}
3232
- uses: Swatinem/[email protected]
33+
- run: cargo test --workspace
3334

34-
- name: Lint
35-
run: |
36-
cargo fmt -- --check
37-
cargo clippy --all-targets --all-features --all
35+
fmt:
36+
name: Rustfmt
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- run: rustup override set ${{env.MSRV}}
41+
- run: rustup component add rustfmt
42+
- uses: Swatinem/[email protected]
43+
- run: cargo fmt --all -- --check
3844

39-
- name: Test
40-
run: cargo test
45+
clippy:
46+
name: Clippy
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
- run: rustup override set ${{env.MSRV}}
51+
- run: rustup component add clippy
52+
- uses: Swatinem/[email protected]
53+
- run: cargo clippy --workspace -- --deny warnings

0 commit comments

Comments
 (0)