Skip to content

Commit 0b92679

Browse files
authored
other: add v1 schema + versioning + tests (#1407)
* other: add v1.0 schema * add tests, rename some files for consistency
1 parent b666061 commit 0b92679

File tree

9 files changed

+503
-1
lines changed

9 files changed

+503
-1
lines changed
File renamed without changes.

Diff for: .github/workflows/test-docs.yml renamed to .github/workflows/test_docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
2020
with:
2121
skip_after_successful_duplicate: "true"
22-
paths: '["docs/**", ".github/workflows/docs.yml", ".github/workflows/test-docs.yml"]'
22+
paths: '["docs/**", ".github/workflows/docs.yml", ".github/workflows/test_docs.yml"]'
2323
do_not_skip: '["workflow_dispatch"]'
2424

2525
test-build-documentation:

Diff for: .github/workflows/validate_schema.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Workflow to validate the latest schema.
2+
3+
name: "validate schema"
4+
on:
5+
workflow_dispatch:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- "schema/**"
12+
- ".github/workflows/validate_schema.yml"
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'ClementTsang/bottom' }}
17+
18+
jobs:
19+
pre-job:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
23+
steps:
24+
- id: skip_check
25+
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
26+
with:
27+
skip_after_successful_duplicate: "true"
28+
paths: '["schema/**", ".github/workflows/validate_schema.yml"]'
29+
do_not_skip: '["workflow_dispatch"]'
30+
31+
test-build-documentation:
32+
name: Test validating schema
33+
needs: pre-job
34+
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
39+
with:
40+
fetch-depth: 0
41+
42+
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
43+
with:
44+
python-version: 3.11
45+
46+
- name: Install Python dependencies
47+
run: pip install -r scripts/schema/requirements.txt
48+
49+
- name: Test nightly validates on valid sample configs
50+
run: |
51+
python3 scripts/schema/validator.py -s ./schema/nightly/bottom.json -f ./sample_configs/default_config.toml
52+
python3 scripts/schema/validator.py -s ./schema/nightly/bottom.json -f ./sample_configs/demo_config.toml
53+
54+
- name: Test nightly catches on a bad sample config
55+
run: |
56+
python3 scripts/schema/validator.py -s ./schema/nightly/bottom.json -f scripts/schema/bad_file.toml --should_fail

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ supply-chain/
4545

4646
# samply profiling
4747
profile.json
48+
49+
**/venv/

0 commit comments

Comments
 (0)