-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (65 loc) · 2.17 KB
/
e2e.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
name: Cypress Tests
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
sleep:
name: Wait for the vercel build to complete
runs-on: ubuntu-latest
steps:
- name: Waiting for Vercel Preview
uses: patrickedqvist/[email protected]
id: waitForVercel
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 600
check_interval: 30
cypress-run:
runs-on: ubuntu-latest
needs: [sleep]
container:
image: cypress/browsers:latest
options: --user 1001
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
name: Testing e2e in worker ${{ matrix.containers }}
if: github.event.pull_request.draft == false
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: Setup baseUrl to deploy-preview
if: ${{ success() && steps.branch-name.outputs.is_default == 'false' }}
run: |
echo "CYPRESS_baseUrl=https://nosgestesclimat-git-${{ steps.branch-name.outputs.current_branch }}-ademe.vercel.app" >> "$GITHUB_ENV";
echo "MODE=preview" >> "$GITHUB_ENV";
- name: Setup baseUrl to https://nosgestesclimat.vercel.app
if: ${{ !success() || steps.branch-name.outputs.is_default == 'true' }}
run: |
echo "CYPRESS_baseUrl=https://nosgestesclimat.vercel.app" >> "$GITHUB_ENV"
echo "MODE=production" >> "$GITHUB_ENV"
- name: Test - e2e [${{ env.MODE }}]
uses: cypress-io/[email protected]
with:
build: yarn run e2e:generate
browser: chrome
parallel: true
record: true
group: 'Test - e2e'
spec: cypress/e2e/integration/**/*.cy.js
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
SERVER_URL: ${{ secrets.SERVER_URL }}
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}