diff --git a/.gitea/workflows/browser-e2e.yml b/.gitea/workflows/browser-e2e.yml new file mode 100644 index 0000000..51462c1 --- /dev/null +++ b/.gitea/workflows/browser-e2e.yml @@ -0,0 +1,56 @@ +name: TaxBaik Browser E2E + +on: + push: + branches: + - master + +jobs: + browser-e2e: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: npm + + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: | + ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-playwright- + + - name: Install Playwright dependencies + run: | + set -e + npm ci + npx playwright install chromium --with-deps + + - name: Wait for deployment + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + run: | + set -e + for i in $(seq 1 30); do + if curl -fsS "http://${DEPLOY_HOST}/taxbaik/healthz" >/dev/null; then + exit 0 + fi + sleep 10 + done + echo "Deployment did not become healthy in time" >&2 + exit 1 + + - name: Browser E2E verification + env: + E2E_BASE_URL: http://${{ secrets.DEPLOY_HOST }}/taxbaik + E2E_ADMIN_USERNAME: admin + E2E_ADMIN_PASSWORD: ${{ secrets.TAXBAIK_ADMIN_TEST_PASSWORD }} + run: npm run test:e2e diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index f05700e..8e4e8ed 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -149,39 +149,3 @@ jobs: echo "Service verification failed (home: $HOME_STATUS, login: $LOGIN_STATUS, auth: $AUTH_BODY)" >&2 exit 1 fi - - browser-e2e: - runs-on: ubuntu-latest - needs: build-and-deploy - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: npm - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: | - ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-playwright- - - - name: Install Playwright dependencies - run: | - set -e - npm ci - npx playwright install chromium - - - name: Browser E2E verification - env: - E2E_BASE_URL: http://${{ secrets.DEPLOY_HOST }}/taxbaik - E2E_ADMIN_USERNAME: admin - E2E_ADMIN_PASSWORD: ${{ secrets.TAXBAIK_ADMIN_TEST_PASSWORD }} - run: npm run test:e2e