Files
radicle-explorer/.github/workflows/check-e2e.yml
T
Rūdolfs Ošiņš 41168db8d5 Improve CI workflows
- bump visual spec timeouts
- don't warn if there are no artifacts
- revert unneeded workflow checks
- improve workflow messages

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2022-12-16 23:10:57 +01:00

70 lines
2.0 KiB
YAML

name: check-e2e
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check-e2e:
continue-on-error: true
strategy:
matrix:
browser: [chromium, firefox, visual]
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12.1"
- name: Install dependencies
run: npm ci
- name: Cache Playwright browsers
uses: actions/cache@v3
id: playwright-dep-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
- name: Cache Playwright visual snapshots
uses: actions/cache@v3
id: playwright-snapshot-cache
with:
path: tests/visual/snapshots/**/*
key: ${{ runner.os }}-snapshots
- name: Install Playwright browsers and OS dependencies if cache miss
if: steps.playwright-dep-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Install only Playwright OS dependencies if cache hit
if: steps.playwright-dep-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps
- name: Start http-api test server
run: ./scripts/run-http-api-with-fixtures --non-interactive --detach
- name: Run Playwright tests
run: |
if [ ${{ matrix.browser }} = "visual" ] && [ ${{ github.ref }} = "refs/heads/master" ]; then
npm run test:e2e -- --project ${{ matrix.browser }} --update-snapshots;
else
npm run test:e2e -- --project ${{ matrix.browser }};
fi
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: test-artifacts-${{ runner.os }}
retention-days: 30
if-no-files-found: "ignore"
path: |
tests/artifacts/**/*