Skip to content

Commit 1607f13

Browse files
committed
Setup CI for docs
1 parent cd219d3 commit 1607f13

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/ci.yaml

+29-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,38 @@ jobs:
4242
path: ${{ steps.go-cache-paths.outputs.GOCACHE }}
4343
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
4444

45-
# Install Go!
4645
- uses: actions/setup-go@v3
4746
with:
4847
go-version: "~1.21"
4948

5049
- name: Test
5150
run: make test
51+
docs:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
with:
57+
ref: ${{ github.event.pull_request.head.sha }}
58+
59+
- name: Echo Go Cache Paths
60+
id: go-cache-paths
61+
run: |
62+
echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
63+
echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
64+
65+
- name: Go Build Cache
66+
uses: actions/cache@v3
67+
with:
68+
path: ${{ steps.go-cache-paths.outputs.GOCACHE }}
69+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
70+
71+
- uses: actions/setup-go@v3
72+
with:
73+
go-version: "~1.21"
74+
75+
- name: Generate docs
76+
run: make docs
77+
78+
- name: Check for unstaged files
79+
run: git diff --exit-code

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ develop:
77
build: scripts/envbuilder-$(GOARCH)
88
./scripts/build.sh
99

10+
docs: options.go
11+
go run ./scripts/docsgen/main.go
12+
1013
.PHONY: test
1114
test: test-registry test-images
1215
go test -count=1 ./...

0 commit comments

Comments
 (0)