diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..51c64071 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,66 @@ +name: tests +on: + push: + branches: + - 'master' + - 'renovate/**' + tags: + - '*.*.*' + pull_request: + branches: + - 'master' + +jobs: + unit-tests: + name: unit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Run unit tests + run: pnpm test + + e2e-tests: + name: end to end + services: + mongo: + image: mongo:latest + ports: + - 27017:27017 + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Run Playwright tests + run: pnpm test:e2e + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30