E2E Tests #68
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: E2E Tests | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 11 * * *' # Runs every day at 11:00 UTC (6:00 AM EST) | |
jobs: | |
setup: | |
uses: ./.github/workflows/setup-workspace.yaml | |
test: | |
name: E2E Tests | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Job | |
uses: ./.github/actions/setup-job | |
- name: Install Playwright Browsers | |
shell: bash | |
run: pnpm run postinstall:setup-playwright | |
- name: Run E2E Tests | |
shell: bash | |
env: | |
# Inject app secrets like API keys here from github secrets | |
ABORT_DELAY: 5000 | |
APP_NAME: Example App | |
run: | | |
# @UPDATE - Normally would not be needed but we have no test environment in this template. Remove this section for actual apps | |
sudo echo "127.0.0.1 local.example-test.com" | sudo tee -a /etc/hosts | |
pnpm run postinstall:setup-cert | |
# ---- # | |
if [ "${{ github.event_name }}" == "schedule" ]; then | |
pnpm run test:e2e:test | |
else | |
pnpm run test:e2e:local | |
fi | |
- name: Upload E2E Report | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |