Update codecov/codecov-action digest to 1e68e06 (#2719) #9471
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: | |
# Configure this workflow to trigger on pull requests and pushes to main | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
permissions: | |
contents: read | |
actions: write | |
env: | |
NEXT_PUBLIC_API_BASE_URL: 'http://localhost:9090' | |
HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }} | |
HAPPO_API_SECRET: ${{ secrets.HAPPO_API_SECRET }} | |
HAPPO_NONCE: '${{ github.run_id || github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
concurrency: | |
# Group name from GitHub workflow example so it doesn't cancel jobs in parallel with matrix | |
# (https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix#example-workflow) | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
cypress: | |
name: Cypress | |
runs-on: ubuntu-latest | |
container: cypress/browsers:node-18.14.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1@sha256:58a0ab8e7ec13931f11746e9f708baacf12c1fabf14cc5173e5ba2acbe5248f3 | |
strategy: | |
# when one test fails, DO NOT cancel the other | |
# containers, because this will kill Cypress processes | |
# leaving the Dashboard hanging ... | |
# https://github.com/cypress-io/github-action/issues/48 | |
fail-fast: false | |
matrix: | |
# run 2 copies of the current job in parallel | |
containers: [1, 2] | |
steps: | |
# Arrange | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
# Act | |
- name: Run Cypress | |
uses: cypress-io/github-action@9c49190e9585ab72e63ff2b4d599963a79da431e | |
with: | |
install-command: pnpm install | |
browser: chrome | |
build: pnpm build | |
start: | | |
pnpm start | |
pnpm mock-api | |
wait-on: 'http://localhost:3000, ${{ env.NEXT_PUBLIC_API_BASE_URL }}' | |
record: true | |
parallel: true | |
group: merge | |
# tag will be "push", "pull_request", or "merge_group" | |
tag: ${{ github.event_name }} | |
command-prefix: ${{ github.event_name != 'merge_group' && 'pnpm exec happo-e2e -- pnpm exec' || '' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} | |
# - if the event is push, the title will be undefined | |
# and Cypress will get the commit message from Git information | |
# - if the event is pull_request, then we set the commit | |
# - if the event is merge_group, then we set the commit | |
# message to the pull request title | |
# https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260 | |
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.merge_group.head_commit.message }} | |
finalize-happo: | |
name: Finalize Happo | |
runs-on: ubuntu-latest | |
if: ${{ !cancelled() && github.event_name != 'merge_group' }} | |
needs: [cypress] | |
steps: | |
# Arrange | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
# Act | |
- name: Run Happo | |
run: pnpm exec happo-e2e finalize | |
dummy-happo: | |
name: Happo | |
runs-on: ubuntu-latest | |
if: ${{ !cancelled() && github.event_name == 'merge_group' }} | |
steps: | |
- name: Dummy Happo | |
run: echo "Dummy Happo in the queue" |