66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
name: Playwright Tests
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
jobs:
|
|
test:
|
|
timeout-minutes: 60
|
|
runs-on: [self-hosted, linux]
|
|
defaults:
|
|
run:
|
|
working-directory: ./leaky-ships
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
name: Install pnpm
|
|
with:
|
|
version: 8.7.4
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- uses: actions/cache@v3
|
|
name: Setup pnpm cache
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./leaky-ships/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Add FA token
|
|
run: |
|
|
npm config set "@fortawesome:registry" "https://npm.fontawesome.com/"
|
|
npm config set "//npm.fontawesome.com/:_authToken" "${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Install Playwright Browsers
|
|
run: pnpm playwright install --with-deps
|
|
|
|
- name: 'Compiling page'
|
|
run: |
|
|
echo "${{ secrets.ENV_FILE }}" > .env
|
|
pnpm build
|
|
|
|
- name: Run Playwright tests
|
|
run: pnpm playwright test
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: leaky-ships/playwright-report/
|
|
retention-days: 30
|