blob: ea50853b5d11943b5ffcc7e079fc1d7dfa114685 [file] [log] [blame]
Philip Zeyliger4de80d22025-04-23 12:33:31 -07001name: Code Formatting
2on:
3 workflow_call:
4 push:
5 branches-ignore:
6 - "queue-main-**"
7 pull_request:
8
9jobs:
10 formatting:
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v4
14
15 # Setup for Prettier
16 - name: Setup Node.js
17 uses: actions/setup-node@v4
18 with:
19 node-version: '20'
20 cache: 'npm'
21 cache-dependency-path: loop/webui/package-lock.json
22
23 - name: Install dependencies
24 working-directory: ./loop/webui
25 run: npm ci
26
27 - name: Check Prettier formatting
28 working-directory: ./loop/webui
29 run: npx prettier --check .
30
31 # Setup for gofumpt
32 - name: Setup Go
33 uses: actions/setup-go@v4
34 with:
35 go-version: stable
36 cache: true
37
38 - name: Install gofumpt v0.8.0
39 run: |
40 go install mvdan.cc/gofumpt@v0.8.0
41 echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
42
43 - name: Check Go formatting
44 run: gofumpt -l . | grep . && { echo "Go files need formatting"; exit 1; } || echo "Go formatting check passed"