Files
pve-panel/.github/workflows/test.yml
2026-10-03 01:20:20 +02:00

67 lines
1.6 KiB
YAML

# Automated tests: unit + API tests (simulated Proxmox, real panel process) on
# Node 22 and 24, and browser tests (Playwright, Chromium).
#
# Runs for pull requests and branches other than main. On main and release tags
# the Docker workflow calls this workflow first and only publishes the image when
# all tests pass.
name: Tests
on:
pull_request:
push:
branches-ignore: [main]
workflow_call:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
unit-and-api:
name: Unit + API (Node ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- name: Run unit and API tests
run: npm test
browser:
name: Browser (Playwright)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Install Chromium
run: npx playwright install --with-deps chromium
- name: Run browser tests
run: npm run test:e2e
- name: Keep the report when something failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 14