forked from y-scope/clp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclp-docs-generated-code-checks.yaml
More file actions
41 lines (35 loc) · 1.24 KB
/
Copy pathclp-docs-generated-code-checks.yaml
File metadata and controls
41 lines (35 loc) · 1.24 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
name: "clp-docs-generated-code-checks"
on:
pull_request:
push:
workflow_dispatch:
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
# Cancel in-progress jobs for efficiency
cancel-in-progress: true
jobs:
check-generated:
# Runs only on Ubuntu Jammy (22.04) since the Rust components are only built on this platform.
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
with:
submodules: "recursive"
- uses: "./tools/yscope-dev-utils/exports/github/actions/install-go-task"
with:
version: "3.48.0"
- name: "Generate OpenAPI docs"
shell: "bash"
run: "task codegen:openapi"
- name: "Check if the generated code is the latest"
shell: "bash"
run: |-
stale_files="$(git status --porcelain docs/src/_static/generated)"
if [[ -n "${stale_files}" ]]; then
echo >&2 "ERROR: The following generated files are out of date:"
echo >&2 "${stale_files}"
echo >&2 ""
echo >&2 "Please run 'task codegen:openapi' locally and commit the updated files."
git diff >&2 docs/src/_static/generated
exit 1
fi