-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (70 loc) · 2.25 KB
/
main.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
name: End-to-end tests
on:
pull_request:
paths:
- tests/**
- cypress/**
- utils/**
workflow_dispatch:
inputs:
title:
description: 'Title that will appear in the Dashboard'
required: false
default: 'E2E tests'
env:
description: 'Environment (beta or stable)'
required: false
default: 'stable'
workspace:
description: 'VTEX workspace'
required: false
default: 'master'
spec:
description: 'Specify the files to run. Example: **/*vtexgame1.test.js run only vtexgame1 tests'
required: false
default: '**/*'
containers:
description: 'Number of parallel containers'
required: false
default: '30'
jobs:
setup_containers:
runs-on: ubuntu-20.04
outputs:
containers: ${{ steps.setup-containers.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup containers
id: setup-containers
run: bash .github/setup-containers.sh ${{ github.event.inputs.containers }}
cypress_run:
runs-on: ubuntu-20.04
needs: setup_containers
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
containers: ${{ fromJson(needs.setup_containers.outputs.containers) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress run
uses: cypress-io/[email protected]
with:
config-file: cypress.config.ts
tag: 'env:${{ github.event.inputs.env }},wks:${{ github.event.inputs.workspace }},spec:${{ github.event.inputs.spec }}'
group: ''
spec: ${{ github.event.inputs.spec }}
record: true
parallel: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY}}
CYPRESS_VTEX_ENV: ${{ github.event.inputs.env }}
CYPRESS_VTEX_WORKSPACE: ${{ github.event.inputs.workspace }}
CYPRESS_APP_KEY: ${{ secrets.APP_KEY }}
CYPRESS_APP_TOKEN: ${{ secrets.APP_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.inputs.title }}
COMMIT_INFO_AUTHOR: ${{ github.actor }}
COMMIT_INFO_EMAIL: [email protected]