From 7e3d1fef3deb760f3c4a91cf4c769644e981ba69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20S=C3=B6derberg?= Date: Sat, 11 Jul 2026 19:41:48 +0200 Subject: [PATCH] Release flow fixed --- .gitea/workflows/release.yaml | 42 ---------------- .gitea/workflows/test-release.yaml | 81 ++++++++++++++++++++++++++++++ .gitea/workflows/tests.yaml | 42 ---------------- 3 files changed, 81 insertions(+), 84 deletions(-) delete mode 100644 .gitea/workflows/release.yaml create mode 100644 .gitea/workflows/test-release.yaml delete mode 100644 .gitea/workflows/tests.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml deleted file mode 100644 index a78fbc5..0000000 --- a/.gitea/workflows/release.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build Release - -on: [release] - -jobs: - tests: - uses: ./.gitea/workflows/tests.yaml - - build-docker: - runs-on: ubuntu-latest - - permissions: - packages: write - contents: read - - strategy: - matrix: - service: [backend, frontend] - - steps: - - uses: actions/checkout@v4 - - name: Log in to Registry - uses: docker/login-action@v3 - with: - registry: git.stws.cc - username: ${{ github.actor }} - password: ${{ secrets.REGISTRY_TOKEN }} - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: git.stws.cc/${{ github.repository }}/${{ matrix.service }} - tags: | - type=ref,event=tag - type=raw,value=latest - - name: Build and Push - uses: docker/build-push-action@v6 - with: - context: ./${{ matrix.service }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitea/workflows/test-release.yaml b/.gitea/workflows/test-release.yaml new file mode 100644 index 0000000..9fa3c1d --- /dev/null +++ b/.gitea/workflows/test-release.yaml @@ -0,0 +1,81 @@ +name: Test and Release + +on: + push: + branches: ["**"] + pull_request: + branches: ["main", "master"] + release: + types: [published] + +jobs: + test-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: | + cd backend + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Test with pytest + run: | + cd backend + pip install pytest pytest-cov + pytest + + test-frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "npm" + - name: Install dependencies + run: | + cd frontend + npm ci + - name: Test with NPM + run: | + cd frontend + npm test -- run --exclude "**/*.live.test.ts" + + build-docker: + needs: [test-backend, test-frontend] + runs-on: ubuntu-latest + if: github.event_name == 'release' + permissions: + packages: write + contents: read + strategy: + matrix: + service: [backend, frontend] + steps: + - uses: actions/checkout@v4 + - name: Log in to Registry + uses: docker/login-action@v3 + with: + registry: git.stws.cc + username: ${{ github.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: git.stws.cc/${{ github.repository }}/${{ matrix.service }} + tags: | + type=ref,event=tag + type=raw,value=latest + - name: Build and Push + uses: docker/build-push-action@v6 + with: + context: ./${{ matrix.service }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml deleted file mode 100644 index 68a3595..0000000 --- a/.gitea/workflows/tests.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Test Code - -on: [push, workflow_call, pull_request] - -jobs: - test-backend: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install dependencies - run: | - cd backend - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Test with pytest - run: | - cd backend - pip install pytest pytest-cov - pytest - - test-frontend: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: "20.x" - - name: Install dependencies - run: | - cd frontend - npm ci - - name: Test with NPM - run: | - cd frontend - npm test -- run --exclude "**/*.live.test.ts"