fix(e2e): breaking builds #16
Workflow file for this run
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: 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://rekor.sigstore.dev" | |
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: Build Next.js app | |
run: npm run build | |
env: | |
NODE_ENV: ${{ matrix.env.name }} | |
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: ${{ matrix.env.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN }} | |
- 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 |