-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.18 KB
/
Copy pathgenerate.yml
File metadata and controls
43 lines (36 loc) · 1.18 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
name: Generate
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
openapi:
name: OpenAPI Up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install openapi-gen
run: go install k8s.io/kube-openapi/cmd/openapi-gen@latest
- name: Generate OpenAPI
run: |
openapi-gen \
--output-dir pkg/openapi \
--output-pkg github.com/devsy-org/agentapi/pkg/openapi \
--output-file zz_generated.openapi.go \
github.com/devsy-org/agentapi/pkg/apis/devsy/cluster/v1 \
github.com/devsy-org/agentapi/pkg/apis/devsy/storage/v1 \
github.com/devsy-org/admin-apis/pkg/licenseapi \
k8s.io/apimachinery/pkg/apis/meta/v1 \
k8s.io/api/core/v1
- name: Check for drift
run: |
if ! git diff --exit-code pkg/openapi/zz_generated.openapi.go; then
echo "::error::Generated OpenAPI file is out of date. Run 'task generate:openapi' and commit the result."
exit 1
fi