-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (36 loc) · 1011 Bytes
/
build.yml
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
29
30
31
32
33
34
35
36
name: Build
on: [push]
permissions:
contents: write
jobs:
CleanupAndTest:
runs-on: ubuntu-latest
container:
image: rust:latest
steps:
- name: Add cargo features
run: rustup component add rustfmt clippy
- name: Checkout repository
uses: actions/checkout@v3
with:
path: repo
- name: Load cached dependencies
uses: Swatinem/rust-cache@v2
- name: Fmt + clippy
run: |
cd repo
cargo clippy --all-features --all-targets --fix
cargo fmt
- name: Apply cleanup
uses: EndBug/add-and-commit@v9
with:
message: 'applying code formatting, lint fixes and toc creation'
cwd: repo
- name: Fail build if clippy finds any error or warning
run: |
cd repo
cargo clippy --all-features --all-targets -- -D warnings -D clippy::pedantic
- name: Run test suite
run: |
cd repo
cargo test --all-features