-
Notifications
You must be signed in to change notification settings - Fork 3
183 lines (151 loc) · 5.11 KB
/
checks.yml
File metadata and controls
183 lines (151 loc) · 5.11 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: checks
on:
push:
branches:
- main
pull_request:
jobs:
compile:
name: compile:required
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup image (Linux)
run: ./.github/scripts/provision-linux-build.sh
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.rustup/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: build
run: cargo build
env:
RUST_BACKTRACE: 1
lint:
name: lint:required
needs: compile # Run after compilation to use the cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup image (Linux)
run: ./.github/scripts/provision-linux-build.sh
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.rustup/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: Run Lint
run: cargo clippy --verbose --tests --benches -- -D warnings
env:
RUST_BACKTRACE: 1
format:
name: fmt:required
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup image (Linux)
run: ./.github/scripts/provision-linux-build.sh
- name: Install Rust toolchain from rust-toolchain.toml
run: rustup show
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.rustup/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
#
# Runs a series of checks to make sure that all the docs
# that need to be generated have been genrated an are up
# to date.
#
cli-ref:
#
# generate the CLI reference file and check if it is up to date
#
name: cli-ref:required
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup image (Linux)
run: ./.github/scripts/provision-linux-build.sh
- name: Show Rust toolchain
run: rustup show
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.rustup/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: generate docs
run: ./scripts/generate-cli-docs.sh
- name: Check for uncommitted changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "❌ The cli-reference documentation is not up to date"
echo ""
echo " Run ./scripts/generate-cli-docs.sh to update them"
echo ""
git status --porcelain
exit 1
else
echo "✅ Git state is clean."
fi
icp-yaml-schema:
#
# generate config schemas and check if they are up to date
#
name: icp-yaml-schema:required
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup image (Linux)
run: ./.github/scripts/provision-linux-build.sh
- name: Show Rust toolchain
run: rustup show
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.rustup/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: generate schemas
run: ./scripts/generate-config-schemas.sh
- name: Check for uncommitted changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "❌ The schema docs are not up to date"
echo ""
echo " Run ./scripts/generate-config-schemas.sh to update them"
echo ""
git status --porcelain
exit 1
else
echo "✅ Git state is clean."
fi