This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (50 loc) · 1.63 KB
/
ci.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Source of this pipeline code: https://github.com/paskausks/rust-bin-github-workflows
# MIT License - Copyright (c) 2019 Rihards Paskausks
# Modified by
# Copyright (c) 2024 Malte Janz
name: CI
on:
pull_request: # trigger on pull requests
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- main # triggers on pushes that contain changes in main
jobs:
build:
name: Build
runs-on: ubuntu-latest # full build + test on every major platform is done by the release pipeline
steps:
- uses: actions/checkout@v4
- name: Install latest stable Rust version
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Cargo build
run: cargo build --verbose
- name: Cargo test
run: cargo test --verbose --all-features
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest stable Rust version
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: cargo fmt -- --check
clippy_check:
name: Clippy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest stable Rust version
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: giraffate/clippy-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all-features
reporter: 'github-pr-review'