Working Playwright test with workflow
This commit is contained in:
parent
eb8aee090f
commit
7f350393ff
8 changed files with 90 additions and 48 deletions
54
.github/workflows/playwright.yml
vendored
54
.github/workflows/playwright.yml
vendored
|
@ -7,21 +7,61 @@ on:
|
|||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, linux]
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./leaky-ships
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 8.6.10
|
||||
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: |
|
||||
echo "@fortawesome:registry=https://npm.fontawesome.com/" > .npmrc
|
||||
npm config set '//npm.fontawesome.com/:_authToken' "${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install --with-deps
|
||||
run: pnpm playwright install --with-deps
|
||||
|
||||
- name: 'Compiling page'
|
||||
run: |
|
||||
echo "${{ secrets.ENV_FILE }}" > .env
|
||||
pnpm prisma generate
|
||||
pnpm run build
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: pnpm exec playwright test
|
||||
run: pnpm playwright test
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
path: leaky-ships/playwright-report/
|
||||
retention-days: 30
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue