forked from sigstore/rekor-search-ui
-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (72 loc) · 2.52 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
78
79
80
81
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"
node: [18]
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
# - name: Download the build folder
# uses: actions/download-artifact@v4
# with:
# name: build
# path: .next
# install npm dependencies, cache them correctly, and run
# all Cypress tests
- name: Run Cypress E2E Tests on Node v${{ matrix.node }}
uses: cypress-io/github-action@v6
with:
browser: ${{ matrix.browser }}
# the entire command will automatically be prefixed with "npm"
# and we need the second "npm" to execute "cypress run ..." command line
command-prefix: "-H 127.0.0.1 -- npx"
parallel: true
record: true
start: npm start
# keep quoted url to be safe against YML parsing surprises
wait-on: "http://127.0.0.1:3000"
env:
NODE_ENV: ${{ matrix.env.name }}
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: ${{ matrix.env.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN }}
CYPRESS_baseUrl: "http://127.0.0.1:3000"
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Screenshot Artifacts 📸
uses: actions/upload-artifact@v4
# if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
- name: Upload Video Artifacts 🎥
uses: actions/upload-artifact@v4
with:
name: cypress-videos
path: cypress/videos
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
# - 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