From 0606b71890f2049f060fc49fb7693fc48947d438 Mon Sep 17 00:00:00 2001 From: Ryan Kegel Date: Sun, 26 Apr 2026 22:43:29 -0400 Subject: [PATCH] feat: add workflow for promoting master to production with testing and deployment steps --- .gitea/workflows/promote-master.yaml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/promote-master.yaml b/.gitea/workflows/promote-master.yaml index d03c288..de95c35 100644 --- a/.gitea/workflows/promote-master.yaml +++ b/.gitea/workflows/promote-master.yaml @@ -20,6 +20,10 @@ on: description: "Run Playwright E2E gate" required: true default: "true" + skip_tests: + description: "Skip the entire tests stage" + required: true + default: "false" deploy: description: "Run production deploy over SSH" required: true @@ -96,31 +100,36 @@ jobs: timeout-minutes: 120 needs: prepare steps: + - name: Skip tests stage + if: ${{ github.event.inputs.skip_tests == 'true' }} + run: echo "Skipping tests stage because skip_tests=true" + - name: Check out promoted ref + if: ${{ github.event.inputs.skip_tests != 'true' }} uses: actions/checkout@v3 with: ref: ${{ needs.prepare.outputs.target_ref }} - name: Set up Python for backend tests - if: ${{ github.event.inputs.run_backend_tests != 'false' || github.event.inputs.run_playwright_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && (github.event.inputs.run_backend_tests != 'false' || github.event.inputs.run_playwright_tests != 'false') }} uses: actions/setup-python@v4 with: python-version: "3.11" - name: Install backend dependencies (runner python) - if: ${{ github.event.inputs.run_backend_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && github.event.inputs.run_backend_tests != 'false' }} run: | python -m pip install --upgrade pip pip install -r backend/requirements.txt - name: Run backend unit tests - if: ${{ github.event.inputs.run_backend_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && github.event.inputs.run_backend_tests != 'false' }} run: | cd backend pytest -q - name: Set up Node.js - if: ${{ github.event.inputs.run_frontend_tests != 'false' || github.event.inputs.run_playwright_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && (github.event.inputs.run_frontend_tests != 'false' || github.event.inputs.run_playwright_tests != 'false') }} uses: actions/setup-node@v4 with: node-version: "20.19.0" @@ -128,29 +137,29 @@ jobs: cache-dependency-path: frontend/package-lock.json - name: Install frontend dependencies - if: ${{ github.event.inputs.run_frontend_tests != 'false' || github.event.inputs.run_playwright_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && (github.event.inputs.run_frontend_tests != 'false' || github.event.inputs.run_playwright_tests != 'false') }} run: npm ci working-directory: frontend - name: Run frontend unit tests - if: ${{ github.event.inputs.run_frontend_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && github.event.inputs.run_frontend_tests != 'false' }} run: npm run test:unit --if-present working-directory: frontend - name: Create backend venv for Playwright webServer - if: ${{ github.event.inputs.run_playwright_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && github.event.inputs.run_playwright_tests != 'false' }} run: | python -m venv backend/.venv backend/.venv/bin/python -m pip install --upgrade pip backend/.venv/bin/python -m pip install -r backend/requirements.txt - name: Install Playwright browsers - if: ${{ github.event.inputs.run_playwright_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && github.event.inputs.run_playwright_tests != 'false' }} run: npx playwright install --with-deps working-directory: frontend - name: Run Playwright tests - if: ${{ github.event.inputs.run_playwright_tests != 'false' }} + if: ${{ github.event.inputs.skip_tests != 'true' && github.event.inputs.run_playwright_tests != 'false' }} run: npx playwright test --reporter=line working-directory: frontend env: