-
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 1.87 KB
/
ci.yaml
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
70
71
72
73
74
name: CI
run-name: ${{ inputs.reason }}
on:
push:
paths-ignore:
- .github/workflows/**
- '!.github/workflows/ci.yaml'
- '!.github/workflows/docker-push.yaml'
- .vscode/**
- .gitignore
- LICENCE
- README.md
pull_request:
branches:
- main
paths-ignore:
- .github/workflows/**
- '!.github/workflows/ci.yaml'
- '!.github/workflows/docker-push.yaml'
- .vscode/**
- .gitignore
- LICENCE
- README.md
workflow_dispatch:
inputs:
reason:
description: Dispatch reason
type: string
required: true
env:
CARGO_TERM_COLOR: always
jobs:
ci:
name: Check Code, Code Formatting and Linting
strategy:
matrix:
rust-toolchain:
- stable
- nightly
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set-up Rust problem matchers
uses: catuhana/rust-problem-matchers@v2
- name: Set-up or update Rust ${{ matrix.rust-toolchain }} toolchain
run: rustup toolchain install ${{ matrix.rust-toolchain }} --profile default
- name: Set-up Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target/
key: ${{ runner.os }}-cargo-${{ matrix.rust-toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check Rust code
run: cargo +${{ matrix.rust-toolchain }} check --verbose --all
- name: Check Rust code format
if: '!cancelled()'
run: cargo +${{ matrix.rust-toolchain }} fmt --verbose --all --check
- name: Check Rust code lint
if: '!cancelled()'
run: cargo +${{ matrix.rust-toolchain }} clippy --verbose -- -W clippy::nursery