-
Notifications
You must be signed in to change notification settings - Fork 13
91 lines (74 loc) · 2.19 KB
/
code_checks.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Code Checks
on: [push]
env:
CARGO_TERM_COLOR: always
CARGO_TERM_VERBOSE: true
RUST_LOG: trace
jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Cargo fmt
run: cargo fmt --check
linting:
name: Check linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Cargo clippy
run: cargo clippy --no-deps --all-targets -- -Dwarnings
udeps:
name: Check unused dependencies
runs-on: ubicloud-standard-8
steps:
- uses: actions/checkout@v4
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-07-27
override: true
- name: Run cargo-udeps
env:
RUSTFLAGS: -A warnings
uses: aig787/cargo-udeps-action@v1
with:
version: "latest"
args: "--workspace --all-features --all-targets"
coverage:
name: Check code coverage percentage
runs-on: ubicloud-standard-16
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: clementine
POSTGRES_USER: clementine
POSTGRES_PASSWORD: clementine
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/service-action
- name: Install Rust
run: rustup update stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage and print that to a JSON file
run: cargo llvm-cov --json --output-path lcov.json --ignore-filename-regex core/src/rpc/clementine.rs # TODO: Remove ignore and test auto generated code too
- name: Check coverage
run: scripts/check_json_code_coverage.py lcov.json
todo:
name: Check for TODO statements
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run script
run: scripts/check_for_todos.sh
continue-on-error: true # TODO: This should be removed later