Skip to content

Commit

Permalink
ci: fix schema diff with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
tigarmo committed Dec 20, 2024
1 parent 86d9d63 commit 116e5a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@ env:

jobs:
diff-schema:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout rockcraft
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up uv with caching
id: setup-uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: ${{ steps.runner-info.outputs.cache-hash }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install requirements
run: pip install -r requirements.txt

- name: Run generator script
run: ./tools/schema/schema.py > generated_schema.json
run: |
uv run --frozen --no-dev --extra apt-jammy \
python tools/schema/schema.py > generated_schema.json
- name: Check with stored schema
run: |
Expand All @@ -49,4 +55,6 @@ jobs:

- name: Run ajv
run: |
ajv validate -s $ROCKCRAFT_JSON -d docs/reference/code/example/rockcraft.yaml --strict=false --spec=draft2020
ajv validate -s $ROCKCRAFT_JSON \
-d docs/reference/code/example/rockcraft.yaml \
--strict=false --spec=draft2020
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 116e5a7

Please sign in to comment.