-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (69 loc) · 1.93 KB
/
code_quality.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
75
76
77
78
79
80
81
82
83
84
name: Code quality
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
env:
OPENSSL_DIR: /usr/include/openssl
OPENSSL_LIB_DIR: /usr/lib/x86_64-linux-gnu
OPENSSL_INCLUDE_DIR: /usr/include/openssl
setup:
runs-on: ubuntu-latest
outputs:
cargo-path: ${{ steps.export-cargo-path.outputs.path }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl git build-essential libssl-dev
- name: Install Rust
id: install-rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Export cargo path
id: export-cargo-path
run: echo "path=$HOME/.cargo/bin" >> $GITHUB_OUTPUT
lint:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Rust
run: echo "$GITHUB_PATH" >> $GITHUB_PATH
- name: Lint
run: cargo clippy -- -D warnings
format:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Rust
run: echo "$GITHUB_PATH" >> $GITHUB_PATH
- name: Format
run: |
cargo fmt -- ./lib/src/serviceinfo/models/*.rs # workaround to fix autogenerated code formatting
cargo fmt -- ./lib/src/tes/models/*.rs
cargo fmt -- --check
spell-check:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Rust
run: echo "$GITHUB_PATH" >> $GITHUB_PATH
- name: Check spellings
run: cargo spellcheck