-
Notifications
You must be signed in to change notification settings - Fork 126
108 lines (103 loc) · 3.06 KB
/
checks.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Checks
on:
pull_request:
branches: [main]
merge_group:
branches: [main]
push:
branches: [main]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources
license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check license headers
run: ./.github/checks/copyright.sh
safety:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Safety checks
run: ./.github/checks/safety.sh -a
unused-deps:
strategy:
matrix:
crate: [
".", # tremor-runtime
"tremor-api",
"tremor-cli",
"tremor-codec",
"tremor-common",
"tremor-influx",
"tremor-interceptor",
"tremor-pipeline",
"tremor-script",
"tremor-value",
"tremor-system",
"tremor-connectors",
"tremor-connectors-aws",
"tremor-connectors-azure",
"tremor-connectors-gcp",
"tremor-connectors-otel",
"tremor-connectors-object-storage",
"tremor-connectors-test-helpers",
]
runs-on: ubuntu-latest
steps:
- name: Install deps
run: sudo snap install remarshal
- name: Install deps
run: sudo snap install --classic ripgrep
- uses: actions/checkout@v4
- name: Check for unused dependencies
run: ./.github/checks/deps.sh ${{ matrix.crate }}
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Formating
run: cargo fmt --all -- --check
clippy-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install deps
run: sudo apt-get -qy update && sudo apt-get install -y libssl-dev libssl1.1
- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/[email protected]
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy action to produce annotations
uses: giraffate/clippy-action@v1
if: steps.check_permissions.outputs.has-permission
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all -- -Dwarnings
- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo clippy --all
code-quality:
if: ${{ always() }}
name: Code Quality
runs-on: ubuntu-latest
needs: [format, clippy-check, unused-deps, safety, license, audit]
steps:
- run: exit 1
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}