From 5296178be45dfda8fab8a28812a7d47497c26124 Mon Sep 17 00:00:00 2001 From: Jared Frazier Date: Wed, 8 Apr 2026 10:24:07 +0200 Subject: [PATCH 1/2] add ci workflow --- .github/workflows/ci.yml | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f012f3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: CI + +on: + push: + branches: ["main"] + + # trigger on change to this workflow + pull_request: + paths: + - '.github/workflows/ci.yml' + + # allow trigger manually from actions + workflow_dispatch: + +# Cancel jobs running if new commits are pushed +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + style: + name: "style" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Install uv" + uses: astral-sh/setup-uv@v10 + with: + enable-cache: true + + - name: "Install project" + run: | + uv sync + + - name: "pre-commit check" + run: | + uv run prek --all-files + + test-backend: + name: "test backend with pytest" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "check for changes to python files" + uses: dorny/paths-filter@v4 + id: changes + with: + filters: | + python: + - "**/*.py" + + - name: "Install uv" + if: steps.changes.outputs.python == 'true' + uses: astral-sh/setup-uv@v10 + with: + enable-cache: true + + - name: "Install project" + if: steps.changes.outputs.python == 'true' + run: | + uv sync + + - name: "pytest" + if: steps.changes.outputs.python == 'true' + run: | + uv run pytest -v tests/ From a0a06e70f37dfa5309fccc8b8a00ed1058048cab Mon Sep 17 00:00:00 2001 From: Jared Frazier Date: Wed, 8 Apr 2026 10:25:12 +0200 Subject: [PATCH 2/2] update astral version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f012f3..e610d47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 - name: "Install uv" - uses: astral-sh/setup-uv@v10 + uses: astral-sh/setup-uv@v7 with: enable-cache: true @@ -57,7 +57,7 @@ jobs: - name: "Install uv" if: steps.changes.outputs.python == 'true' - uses: astral-sh/setup-uv@v10 + uses: astral-sh/setup-uv@v7 with: enable-cache: true