-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.43 KB
/
formatting-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
name: Formatting Backend and Scripts
on:
pull_request:
paths:
- # Files formatted by ./scripts/format.cargo.sh
'**/Cargo.toml'
- # Files formatted by ./scripts/format.rust.sh
'**/*.rs'
- # Files formatted by ./scripts/format.sh.sh
# Note: shell scripts not ending in .sh are found with: scripts/format.sh.sh --list | grep -vE 'sh$'
'**/*.sh'
- 'docker/*'
- 'scripts/*'
- # This workflow
'.github/workflows/formatting-checks.yml'
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install shfmt
run: sudo snap install --classic shfmt
- name: Install binstall
run: |
BINSTALL_VERSION="1.8.0"
curl -L --proto '=https' --tlsv1.2 -sSf "https://github.com/cargo-bins/cargo-binstall/releases/download/v${BINSTALL_VERSION}/cargo-binstall-x86_64-unknown-linux-musl.tgz" | tar -xvzf - cargo-binstall
./cargo-binstall -y --force "cargo-binstall@$BINSTALL_VERSION"
rm cargo-binstall
- name: Install cargo dependency sorter
run: cargo binstall --no-confirm [email protected]
- name: Format
run: ./scripts/format.sh
- name: Check formatted
run: |
test -z "$(git status --porcelain)" || {
echo "FIX: Please run ./scripts/format.sh"
git diff
exit 1
}