add initial playwright suite #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Playwright Tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
env: | |
NODE: 16 | |
jobs: | |
prep: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ env.NODE }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE }} | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} | |
- name: Install | |
run: yarn | |
- name: Install Playwright Browsers | |
run: yarn playwright install --with-deps | |
playwright: | |
timeout-minutes: 60 | |
needs: prep | |
runs-on: ubuntu-latest | |
steps: | |
- name: Playwright tests | |
env: | |
MAPBOX_TOKEN: ${{secrets.MAPBOX_TOKEN}} | |
run: yarn test:e2e | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |