forked from y-scope/clp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclp-s-generated-code-checks.yaml
More file actions
53 lines (46 loc) · 1.54 KB
/
Copy pathclp-s-generated-code-checks.yaml
File metadata and controls
53 lines (46 loc) · 1.54 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
44
45
46
47
48
49
50
51
52
53
name: "clp-s-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:
antlr-code-committed:
name: "antlr-code-committed"
strategy:
matrix:
os:
- "macos-15"
- "ubuntu-24.04"
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
with:
submodules: "recursive"
- uses: "./tools/yscope-dev-utils/exports/github/actions/install-java"
- uses: "./tools/yscope-dev-utils/exports/github/actions/install-go-task"
with:
version: "3.48.0"
- name: "Generate parsers"
shell: "bash"
run: "task codegen:clp-s-generate-parsers"
- name: "Check if the generated parsers are the latest"
shell: "bash"
run: |-
generated_paths=(
components/core/src/clp_s/search/kql/generated
components/core/src/clp_s/search/sql/generated
)
stale_files="$(git status --porcelain "${generated_paths[@]}")"
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:clp-s-generate-parsers' locally and commit the" \
"updated files."
git diff >&2 "${generated_paths[@]}"
exit 1
fi