Skip to content

Commit b62329e

Browse files
alixinnevtavernier
authored andcommitted
ci: add cargo check and clippy
1 parent 2d8d588 commit b62329e

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

.github/workflows/build.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ on: [push, pull_request]
44

55
env:
66
ENABLE_PYO3: 1
7+
RUSTFLAGS: -D warnings
78

89
jobs:
910
checks:
11+
name: Check code
12+
1013
runs-on: ubuntu-20.04
1114

1215
steps:
@@ -20,15 +23,36 @@ jobs:
2023
with:
2124
target: ${{ matrix.target }}
2225
profile: minimal
23-
components: rustfmt
26+
components: rustfmt,clippy
2427

2528
- name: Check formatting
2629
uses: actions-rs/cargo@v1
2730
with:
2831
command: fmt
2932
args: -- --check
3033

34+
- name: Install cargo-hack
35+
run: >
36+
wget -O-
37+
https://github.com/taiki-e/cargo-hack/releases/download/v0.5.12/cargo-hack-x86_64-unknown-linux-gnu.tar.gz |
38+
tar -C $HOME/.cargo/bin -xz
39+
40+
- name: Run cargo check
41+
uses: actions-rs/cargo@v1
42+
with:
43+
command: hack
44+
args: check --feature-powerset --no-dev-deps
45+
46+
- name: Run clippy
47+
uses: actions-rs/cargo@v1
48+
with:
49+
command: hack
50+
# Allow clippy warnings until they're fixed, but report them
51+
args: clippy --feature-powerset --no-dev-deps -- -A warnings
52+
3153
build:
54+
name: Build hyperion.rs binaries
55+
3256
strategy:
3357
fail-fast: false
3458
matrix:
@@ -87,9 +111,12 @@ jobs:
87111
path: release/hyperion.rs-${{ matrix.target }}.tar.xz
88112

89113
release-nightly:
90-
needs: build
114+
name: Release hyperion.rs
115+
116+
needs: [ checks, build ]
91117
runs-on: ubuntu-latest
92118
if: "github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')"
119+
93120
steps:
94121
- uses: actions/download-artifact@v2
95122
with:

0 commit comments

Comments
 (0)