Run e2e tests #849
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: Run e2e tests | |
on: | |
deployment_status: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
run-e2es: | |
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Preview – composable-frontend-simple' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: pnpm install && npx playwright install --with-deps | |
- name: Make .env.test file | |
run: | | |
echo "NEXT_PUBLIC_EPCC_CLIENT_ID=${{secrets.E2E_NEXT_PUBLIC_EPCC_CLIENT_ID}}" > ./examples/simple/.env.test | |
echo "EPCC_CLIENT_SECRET=${{secrets.E2E_EPCC_CLIENT_SECRET}}" >> ./examples/simple/.env.test | |
echo "NEXT_PUBLIC_EPCC_ENDPOINT_URL=${{secrets.E2E_NEXT_PUBLIC_EPCC_ENDPOINT_URL}}" >> ./examples/simple/.env.test | |
echo "NEXT_PUBLIC_COOKIE_PREFIX_KEY=${{secrets.E2E_NEXT_PUBLIC_COOKIE_PREFIX_KEY}}" >> ./examples/simple/.env.test | |
echo "SITE_NAME=${{secrets.E2E_SITE_NAME}}" >> ./examples/simple/.env.test | |
- name: Run tests | |
run: pnpm test:e2e | |
env: | |
BASE_URL: ${{ github.event.deployment_status.environment_url }} | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results-${{ github.sha }}-${{ github.run_number }} | |
path: examples/simple/test-results |