-
Notifications
You must be signed in to change notification settings - Fork 29
82 lines (70 loc) · 2.42 KB
/
ci.yml
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
82
name: ci
on:
pull_request:
types: [opened, reopened, synchronize, edited]
jobs:
ci:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
matrix:
containers: [0, 1, 2, 3, 4]
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Setup node env 🏗
uses: actions/setup-node@master
with:
node-version: 20
check-latest: true
cache: 'npm'
- name: Install dependencies 👨🏻💻
run: npm ci
# - name: Run linter 👀
# run: npm run lint
# - name: Run tests 🧪
# run: npm run test
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: chrome
install: false
start: npm run dev
wait-on: 'http://localhost:5173/'
config-file: cypress.config.js
spec: "tests/e2e/**/*"
record: true
parallel: true
group: 'CI - Chrome'
env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
# re-enable PR comment bot
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
- name: Upload Cypress Screenshots
uses: actions/upload-artifact@v3
# Only capture images on failure
if: failure()
with:
name: cypress-screenshots
path: tests/e2e/screenshots
- name: Upload Cypress Videos
uses: actions/upload-artifact@v3
# Only capture videos on failure
if: failure()
with:
name: cypress-videos
path: tests/e2e/videos
- name: Run Coverage
run: npx nyc report --reporter html --reporter text --reporter json-summary --report-dir combined-coverage
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: combined-coverage
- name: Run build 📦
run: npm run build