Skip to content

fix(e2e): breaking builds #13

fix(e2e): breaking builds

fix(e2e): breaking builds #13

Workflow file for this run

name: End-to-End Testing (Cypress) 🚀
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: '0 2 * * FRI'
jobs:
cypress-run:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
browser: [ chrome, electron ]
env:
- name: no-variable
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: ""
- name: with-variable
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: "https://this-is-a-test.com"
env:
CYPRESS_baseUrl: ${{ matrix.env.url }}
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Start Next.js app
run: npm run start &
env:
NODE_ENV: ${{ matrix.env.name }}
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: ${{ matrix.env.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN }}
- name: Wait for Next.js to start
run: npx wait-on http://localhost:3000
- name: Install browsers for Cypress
run: |
if [[ "${{ matrix.browser }}" == "chrome" ]]; then
sudo apt-get install -y google-chrome-stable;
elif [[ "${{ matrix.browser }}" == "firefox" ]]; then
sudo apt-get install -y firefox;
fi
- name: Run Cypress tests
run: npx cypress run --browser ${{ matrix.browser }}
env:
NODE_ENV: ${{ matrix.env.name }}
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: ${{ matrix.env.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN }}
CYPRESS_baseUrl: "http://localhost:3000"
- name: Upload Electron artifacts 📸
uses: actions/upload-artifact@v4
with:
name: electron-artifacts
path: |
./artifacts/electron/videos
./artifacts/electron/screenshots
if-no-files-found: ignore
retention-days: 5