-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gitstart-dub
authored
Oct 31, 2023
1 parent
1e2753b
commit d164bef
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
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 |