diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b635abf..c5fdafd 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -15,7 +15,48 @@ env: IMAGE_NAME: admin/taskplaner jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run type check + run: npm run check -- --output machine + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run unit tests with coverage + run: npm run test:coverage + + - name: Run E2E tests + run: npm run test:e2e + env: + CI: true + + - name: Upload test artifacts + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results + path: | + coverage/ + playwright-report/ + test-results/ + retention-days: 7 + build: + needs: test runs-on: ubuntu-latest steps: - name: Checkout