Skip to content

Commit 3492ed3

Browse files
authored
ci: validate examples (#40)
1 parent a376dc7 commit 3492ed3

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

.github/workflows/test.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,35 @@ on: # yamllint disable-line rule:truthy
55
paths: ["integration-testing/**"]
66
pull_request:
77
paths: ["integration-testing/**"]
8+
permissions:
9+
contents: "read"
810
jobs:
911
integration-testing:
1012
name: "Run Integration Test Example"
1113
runs-on: "ubuntu-latest"
1214
steps:
13-
- uses: "actions/checkout@v3"
14-
- uses: "actions/setup-go@v3"
15-
with:
16-
go-version: "~1.19.1"
15+
- uses: "actions/checkout@v6"
16+
- uses: "actions/setup-go@v6"
1717
- uses: "authzed/actions/go-test@main"
1818
with:
1919
working_directory: "integration-testing"
20+
validate-example-schemas:
21+
name: "Validate Example Schemas"
22+
runs-on: "ubuntu-latest"
23+
steps:
24+
- uses: "actions/checkout@v6"
25+
- name: "Install zed and run validate"
26+
run: |
27+
curl -L https://github.com/authzed/zed/releases/latest/download/zed-linux-amd64 -o zed
28+
chmod +x zed
29+
for schema_file in $(find schemas -name "schema-and-data.yaml" -type f); do
30+
schema_dir=$(dirname "$schema_file")
31+
echo "Validating $schema_file..."
32+
if ! zed validate "$schema_file"; then
33+
echo "Validation failed for $schema_file"
34+
exit_code=1
35+
else
36+
echo "Validation passed for $schema_file"
37+
fi
38+
done
39+
exit $exit_code

0 commit comments

Comments
 (0)