Files
pleno-vue/.github/workflows/tests.yml
T

104 lines
2.5 KiB
YAML

name: Automated Tests
on:
pull_request:
push:
branches: [main, dev]
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
jobs:
build-and-unit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build sanity check
run: npm run build
- name: Unit tests
run: npm run test:unit
e2e-smoke:
if: github.event_name != 'schedule'
needs: build-and-unit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [chromium-desktop, chromium-mobile]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright smoke tests (${{ matrix.project }})
run: npx playwright test --grep @smoke --project="${{ matrix.project }}"
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-smoke-${{ matrix.project }}
path: |
output/playwright/report
output/playwright/test-results
if-no-files-found: ignore
retention-days: 7
e2e-full:
if: github.event_name == 'schedule' || github.ref == 'refs/heads/main'
needs: build-and-unit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run full Playwright suite
run: npm run test:e2e:ci
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-full
path: |
output/playwright/report
output/playwright/test-results
if-no-files-found: ignore
retention-days: 14