-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from luke-h1/feat/e2e-in-ci
fix(ci): add e2e support in CI
- Loading branch information
Showing
4 changed files
with
50 additions
and
4 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
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,36 @@ | ||
name: e2e tests | ||
description: Run e2e tests | ||
inputs: | ||
target: | ||
description: 'make target to execute' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Get installed Playwright version | ||
id: playwright-version | ||
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
with: | ||
path: | | ||
~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | ||
|
||
- name: Install browsers | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
run: make e2e-install-browsers | ||
shell: bash | ||
|
||
- name: ${{ inputs.environment }} UI tests | ||
if: inputs.target == 'e2e-local' | ||
run: ./scripts/setup-e2edb.sh && pnpx start-server-and-test dev 8000 e2e:local | ||
shell: bash | ||
|
||
- name: ${{ inputs.environment }} UI tests | ||
if: inputs.target != 'e2e-local' | ||
run: make ${{ inputs.target }} | ||
shell: bash |
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
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,8 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
trap 'echo -e "\033[31m✖ An error occurred. Exiting...\033[0m"; exit 1;' ERR | ||
|
||
DATABASE_URL='postgresql://pets:pets@localhost:5432/pets?schema=public' pnpm db:migrate-dev && DATABASE_URL='postgresql://pets:pets@localhost:5432/pets?schema=public' pnpm prisma db push | ||
echo -e "\033[32m✔ Test Database migrated\033[0m" |