-
Notifications
You must be signed in to change notification settings - Fork 37
42 lines (36 loc) · 1.08 KB
/
docs-fmt-test.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
---
name: Docs & fmt test
on:
pull_request:
types: ['opened', 'reopened', 'synchronize']
merge_group:
workflow_dispatch:
concurrency:
group: docsfmttest-${{ github.event.pull_request.head.repo.full_name }}/${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
docsfmttest:
name: Docs & fmt test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20.x'
cache-dependency-path: tests/go.sum
- name: Install tools
run: make tools
- name: Check fmt and docs
run: |
echo "==> Running make fmt & make docs"
make fmt
make docs
echo "==> Testing for changes to tracked files"
CHANGES=$(git status -suno)
if [ "$CHANGES" ]; then
echo "Repository formatting or documentation is not correct."
echo "Run 'make fmt && make docs' locally and commit the changes to fix."
exit 1
fi