forked from pgdogdev/pgdog
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.68 KB
/
jsonschema.yml
File metadata and controls
52 lines (48 loc) · 1.68 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
name: jsonschema
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'pgdog-config/src/**/*.rs'
- 'pgdog-config/Cargo.toml'
- 'scripts/jsonschema/src/**/*.rs'
- 'scripts/jsonschema/Cargo.toml'
jobs:
check-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- uses: tombi-toml/setup-tombi@v1
- name: Generate JSON schema
run: |
echo "Remove .cargo/config.toml temporarily to avoid installing additional tools"
rm .cargo/config.toml
cargo run -p pgdog-jsonschema --manifest-path ./pgdog/Cargo.toml
echo "Restore the .cargo/config.toml after script ran successfully"
git restore .cargo/config.toml
- name: Check for uncommitted schema changes
run: |
pwd
if ! git diff --exit-code .schema/; then
echo ""
echo "ERROR: JSON schema files are out of date."
echo ""
echo "The .schema/ files do not match the current pgdog-config types."
echo "Please run the following command locally and commit the result:"
echo ""
echo " cargo run -p pgdog-jsonschema"
echo ""
exit 1
fi
- name: Run example.config toml validation
run: |
if ! tombi lint example.*.toml; then
echo ""
echo "ERROR: Example TOML config files failed schema validation."
echo "Update example.pgdog.toml / example.users.toml to match the latest schema."
echo ""
exit 1
fi