fix(website): cypress code coverage #2751
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: Website-e2e | |
on: | |
push: | |
branches: [main, alpha, dev] | |
pull_request: | |
branches: [main, alpha, dev] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-22.04 | |
env: | |
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{secrets.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: pnpm | |
node-version: '20.5.1' | |
- run: pnpm i --frozen-lockfile | |
- run: pnpm build | |
- name: Set up Cypress binary cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Cypress install | |
uses: cypress-io/github-action@v6 | |
with: | |
runTests: false | |
- name: Cypress verify | |
run: pnpm cypress verify || pnpm cypress install | |
working-directory: packages/website | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
install: false | |
working-directory: packages/website | |
command: pnpm -r --filter @usecannon/website run e2e:headless | |
env: | |
# pass GitHub token to allow accurately detecting a build vs a re-run build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CANNON_E2E_RPC_URL_SEPOLIA: ${{ secrets.CANNON_E2E_RPC_URL_SEPOLIA }} | |
CANNON_E2E_RPC_URL_ETHEREUM: ${{ secrets.CANNON_E2E_RPC_URL_ETHEREUM }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# upload screenshots as an artifact in case of a problem with the cypress build and we dont know what is happening | |
- name: Upload Screenshots | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: screenshots | |
path: packages/website/cypress/screenshots/ | |
if-no-files-found: ignore |