forked from sigstore/rekor-search-ui
-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (66 loc) · 2.17 KB
/
e2e-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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