Skip to content

PW tests for zoom controls and centering #422

PW tests for zoom controls and centering

PW tests for zoom controls and centering #422

Workflow file for this run

name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
typescript-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install node dependencies
run: npm ci
- name: Run typescript
run: npx tsc -p tests/tsconfig.json --noEmit
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install node dependencies
run: npm ci
- name: Prettier check (tests and certain files)
run: npm run prettier-check
jest-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup java for access to `ant`
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install node dependencies
run: npm ci
- name: Test building with ant
run: |
cd resources/build && ant && cd ..
- name: Run js unit tests
run: npm run test
playwright-e2e-tests:
strategy:
matrix:
shardIndex: [1, 2, 3, 4, 5]
shardTotal: [5]
# If one of the shards fails, continue running the remaining tests
fail-fast: false
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout the code under test
uses: actions/checkout@v4
with:
submodules: true
path: 'helioviewer.org'
- name: Checkout the latest Helioviewer API
uses: actions/checkout@v4
with:
repository: 'Helioviewer-Project/api'
path: 'api'
# See https://github.com/actions/checkout?tab=readme-ov-file#fetch-only-a-single-file
- name: Checkout the Dockerfile for local Helioviewer
uses: actions/checkout@v4
with:
repository: 'Helioviewer-Project/helioviewer.org-docker'
path: 'compose'
sparse-checkout: |
compose.yaml
.env.example
sparse-checkout-cone-mode: false
- name: Print current directory
run: |
echo $(pwd)
echo $(ls)
- name: Setup environment file
run: mv compose/.env.example .env
- name: Start local Helioviewer environment
id: docker
run: |
mv compose/compose.yaml .
docker compose up -d --wait
- name: Show docker compose logs
if: always()
run: |
docker compose logs
cat compose.yaml
- name: Fix cache directory permissions
if: always()
run: |
docker compose exec web chown 33:33 cache
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Playwright Browsers
run: |
cd helioviewer.org
npx playwright install --with-deps
- name: Run Playwright tests
run: |
cd helioviewer.org
npx playwright test --shard=${{matrix.shardIndex}}/${{matrix.shardTotal}}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{matrix.shardIndex}}
path: helioviewer.org/playwright-report/
retention-days: 7