Skip to content

Commit 7d3b727

Browse files
committed
Update codebase
1 parent ac20a7d commit 7d3b727

File tree

5 files changed

+9
-488
lines changed

5 files changed

+9
-488
lines changed
Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
name: Validate GPTP Examples
1+
name: (Disabled) Validate GPTP Examples
22

33
on:
4-
push:
5-
branches: [ schema-v1.2 ]
6-
pull_request:
7-
branches: [ schema-v1.2 ]
4+
# Intentionally disabled from automatic runs; can be invoked manually if ever needed
5+
workflow_dispatch:
86

97
jobs:
10-
validate:
8+
noop:
119
runs-on: ubuntu-latest
1210
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v4
15-
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: 20
20-
21-
- name: Install ajv-cli
22-
run: |
23-
npm --version
24-
npm i -g ajv-cli@5.0.0
25-
26-
- name: Validate examples against schema
27-
run: |
28-
ajv validate -s schema/gptp.schema.json -d "docs/examples/*.gptp" --spec=draft7
11+
- run: echo "This workflow is disabled by design for a schema-only repo."
Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
name: Validate GPTP Schema
1+
name: Validate GPTP Schema (meta only)
22

33
on:
44
push:
55
paths:
66
- "schema/gptp.schema.json"
7-
- "docs/examples/**/*.gptp"
87
- ".github/workflows/validate-schema.yml"
98
pull_request:
109
paths:
1110
- "schema/gptp.schema.json"
12-
- "docs/examples/**/*.gptp"
1311
- ".github/workflows/validate-schema.yml"
1412

1513
jobs:
1614
validate:
17-
name: Validate schema and example GPTP files
15+
name: Meta-validate JSON Schema
1816
runs-on: ubuntu-latest
1917

2018
steps:
@@ -26,9 +24,8 @@ jobs:
2624
with:
2725
node-version: "20"
2826

29-
- name: Install AJV CLI and formats
30-
run: |
31-
npm install --no-save ajv@8 ajv-formats@2
27+
- name: Install Ajv (ephemeral)
28+
run: npm install --no-save ajv@8 ajv-formats@2
3229

3330
- name: ✅ Meta-validate gptp.schema.json
3431
run: |
@@ -52,55 +49,5 @@ jobs:
5249
console.log("✅ gptp.schema.json is valid");
5350
EOF
5451
55-
- name: ✅ Validate example .gptp files
56-
run: |
57-
node <<'EOF'
58-
const fs = require('fs');
59-
const path = require('path');
60-
const Ajv = require('ajv').default;
61-
const addFormats = require('ajv-formats');
62-
63-
const ajv = new Ajv({ strict: true, allowUnionTypes: true, allErrors: true });
64-
addFormats(ajv);
65-
66-
const schema = JSON.parse(fs.readFileSync('schema/gptp.schema.json', 'utf8'));
67-
const validate = ajv.compile(schema);
68-
69-
const exampleDir = 'docs/examples';
70-
const files = fs.readdirSync(exampleDir).filter(f => f.endsWith('.gptp'));
71-
72-
if (files.length === 0) {
73-
console.log("⚠️ No .gptp files found in docs/examples/");
74-
process.exit(0);
75-
}
76-
77-
let failures = 0;
78-
79-
for (const file of files) {
80-
const filePath = path.join(exampleDir, file);
81-
try {
82-
const data = JSON.parse(fs.readFileSync(filePath, 'utf8'));
83-
84-
const valid = validate(data);
85-
if (!valid) {
86-
console.error(`❌ ${file} failed validation:`);
87-
console.error(JSON.stringify(validate.errors, null, 2));
88-
failures++;
89-
} else {
90-
console.log(`✅ ${file} passed`);
91-
}
92-
} catch (err) {
93-
console.error(`❌ ${file} could not be read or parsed:`);
94-
console.error(err.message);
95-
failures++;
96-
}
97-
}
98-
99-
if (failures > 0) {
100-
console.error(`❌ ${failures} file(s) failed validation`);
101-
process.exit(1);
102-
}
103-
EOF
104-
10552
- name: Cleanup
10653
run: rm -rf node_modules package-lock.json

0 commit comments

Comments
 (0)