From fab2401b00d4a858e4c9797daec5a5439b927648 Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Fri, 20 Dec 2024 11:11:01 -0300 Subject: [PATCH] ci: fix schema diff with uv --- .github/workflows/schema.yaml | 20 ++++++++++++++------ uv.lock | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/schema.yaml b/.github/workflows/schema.yaml index 5b8094030..ad1c44837 100644 --- a/.github/workflows/schema.yaml +++ b/.github/workflows/schema.yaml @@ -6,7 +6,7 @@ env: jobs: diff-schema: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout rockcraft @@ -14,16 +14,22 @@ jobs: 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: | @@ -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 diff --git a/uv.lock b/uv.lock index ecc031d1f..db73b9c3f 100644 --- a/uv.lock +++ b/uv.lock @@ -2342,7 +2342,7 @@ wheels = [ [[package]] name = "rockcraft" -version = "1.7.0.post13+gf40b0e8.d20241220" +version = "1.7.0.post14+g77c72c3" source = { editable = "." } dependencies = [ { name = "craft-application" },