-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[.github/workflows][s]: add E2E workflow
- Loading branch information
Showing
1 changed file
with
57 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,57 @@ | ||
name: Run E2E Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out E2E tests | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: datopian/flowershow-template-e2e | ||
|
||
- name: Check out Flowershow into test-app | ||
uses: actions/checkout@v2 | ||
with: | ||
path: test-app | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Install dependencies for E2E tests | ||
run: | | ||
npm ci | ||
npx playwright install --with-deps | ||
- name: Install dependencies for template | ||
run: npm ci | ||
working-directory: test-app | ||
|
||
- name: Replace template /content with fixture content | ||
run: | | ||
rm -rf test-app/content | ||
cp -r fixtures/content test-app/content | ||
- name: Build the app | ||
run: npm run export | ||
working-directory: test-app | ||
|
||
- name: Run the tests | ||
run: npx playwright test | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |