Skip to content

chore: add ctrf reporter and run e2e tests after deployment #32

chore: add ctrf reporter and run e2e tests after deployment

chore: add ctrf reporter and run e2e tests after deployment #32

Workflow file for this run

name: E2E tests
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "30 9 * * *"
pull_request:
types: [ opened, synchronize ]
jobs:
test:

Check failure on line 11 in .github/workflows/e2e.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/e2e.yml

Invalid workflow file

You have an error in your yaml syntax on line 11
timeout-minutes: 60
runs-on: ubuntu-latest
env:
PLAYWRIGHT_BROWSERS_PATH: pw-browsers/
defaults:
run:
working-directory: ./e2e
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache restore
uses: actions/cache@v4
with:
path: |
e2e/node_modules
e2e/$PLAYWRIGHT_BROWSERS_PATH
key: "${{ runner.os }}-node-${{ hashFiles('e2e/package-lock.json') }}"
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npm run pw install chromium --with-deps
- name: Run Playwright tests
run: npm test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: |
e2e/playwright-report/
e2e/test-results/
retention-days: 10
- name: Run CTRF results
if: always()
run: |
npx github-actions-ctrf tests ctrf/ctrf-report.json --pr-comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set test result outputs
id: set_test_outputs
if: always()
run: |
echo "TEST_COUNT=`jq '.results.summary.passed' < ./ctrf/ctrf-report.json`" >> $GITHUB_OUTPUT
echo "PASSED_TESTS=`jq '.results.summary.passed' < ./ctrf/ctrf-report.json`" >> $GITHUB_OUTPUT
echo "FAILED_TESTS=`jq '.results.summary.failed' < ./ctrf/ctrf-report.json`" >> $GITHUB_OUTPUT
# - name: Send test output to Slack if failed
# needs: set_test_outputs
# if: needs.set_test_outputs.outputs.FAILED_TESTS > 0
# run: |
# echo "${{ needs.set_test_outputs.outputs.FAILED_TESTS }} out of ${{ needs.set_test_outputs.outputs.TEST_COUNT }} failed for luzmo showcases" >> $GITHUB_STEP_SUMMARY