feat: add github action #1
Workflow file for this run
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: | |
push: | |
jobs: | |
web-playwright-test: | |
name: Check dub web playwright tests | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Node.js version | |
id: nvm | |
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.nvm.outputs.NODE_VERSION }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
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('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright Browsers | |
run: pnpm -r --filter='dub-web' run playwright:install-browsers | |
- name: Run Playwright tests | |
run: pnpm -r --filter='dub-web' run playwright:test | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: apps-web-playwright-report | |
path: apps/web/playwright-report/ | |
retention-days: 30 | |
ui-package-playwright-test: | |
name: Check ui package playwright tests | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Node.js version | |
id: nvm | |
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.nvm.outputs.NODE_VERSION }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
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('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright Browsers | |
run: pnpm -r --filter='@dub/ui' run playwright:install-browsers | |
- name: Run Playwright tests | |
run: pnpm -r --filter='@dub/ui' run playwright:test-ct | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: packages-ui-playwright-report | |
path: packages/ui/playwright-report/ | |
retention-days: 30 |