From 47bbd7ab0c40b566e2f42cbf982a69f1520e66d1 Mon Sep 17 00:00:00 2001 From: zwitschi Date: Sat, 11 Oct 2025 17:40:33 +0200 Subject: [PATCH] feat: add GitHub Actions workflow for backend formatting and testing --- .github/workflows/backend-format.yml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/backend-format.yml diff --git a/.github/workflows/backend-format.yml b/.github/workflows/backend-format.yml new file mode 100644 index 0000000..25a6166 --- /dev/null +++ b/.github/workflows/backend-format.yml @@ -0,0 +1,52 @@ +name: Backend Format + +on: + pull_request: + paths: + - "backend/**" + - "scripts/**" + - "pyproject.toml" + - ".github/workflows/backend-format.yml" + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m venv .venv + source .venv/bin/activate + pip install -e .[dev] + + - name: Run black + run: | + source .venv/bin/activate + black backend + + - name: Run isort + run: | + source .venv/bin/activate + isort backend + + - name: Run pytest + run: | + source .venv/bin/activate + pytest backend/tests + + - name: Upload formatting diff + if: failure() + uses: actions/upload-artifact@v4 + with: + name: backend-formatting-diff + path: | + backend