-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
89 lines (76 loc) · 2.53 KB
/
action.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
83
84
85
86
87
88
89
name: "Platform.sh Cypress test suite"
description: "Run Cypress test specs against platformSH site"
branding:
icon: "crosshair"
color: "green"
inputs:
PLATFORMSH_KEY:
description: "API key for connecting to Platform.sh"
required: true
type: string
PLATFORMSH_ID:
description: "ID for the Platform.sh project."
required: true
type: string
ENVIRONMENT_NAME:
description: "Which environment to check against - defaults to pr-NUMBER"
default: "pr-${{ github.event.pull_request.number }}"
required: false
type: string
WORKING_DIRECTORY:
description: "The directory that contains package.json (default: ./)"
default: "./"
required: false
type: string
ALLOW_CANCEL_CRON:
description: "Can we cancel on-going crons, to speed up deployment? default: 1"
default: 1
required: false
type: integer
FAILED_IMAGE_UPLOAD:
description: "Should failing tests upload fail images to the Action artifacts? default: 0"
default: 0
required: false
type: integer
FAILED_VIDEO_UPLOAD:
description: "Should failing tests upload fail videos to the Action artifacts? default: 0"
default: 0
required: false
type: integer
TARGET_CYPRESS_SPECS:
description: "Specific Cypress specs to run. default: '*/**' (all available)"
default: "*/**"
required: false
type: string
runs:
using: "composite"
steps:
- uses: reload/action-platformsh-url@main
id: platformsh_url
with:
PLATFORMSH_ID: ${{ inputs.PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ inputs.PLATFORMSH_KEY }}
ENVIRONMENT_NAME: ${{ inputs.ENVIRONMENT_NAME }}
ALLOW_CANCEL_CRON: ${{ inputs.ALLOW_CANCEL_CRON }}
- uses: actions/checkout@v3
- name: Cypress tests
uses: cypress-io/github-action@v5
with:
wait-on: ${{ steps.platformsh_url.outputs.url }}
config: video=false
working-directory: ${{ inputs.WORKING_DIRECTORY }}
spec: ${{ inputs.TARGET_CYPRESS_SPECS }}
env:
CYPRESS_BASE_URL: ${{ steps.platformsh_url.outputs.url }}
- uses: actions/upload-artifact@v4
if: ${{ failure() && inputs.FAILED_IMAGE_UPLOAD == 1 }}
with:
name: cypress-screenshots
path: ${{ inputs.WORKING_DIRECTORY }}/cypress/screenshots
if-no-files-found: ignore
- uses: actions/upload-artifact@v4
if: ${{ failure() && inputs.FAILED_VIDEO_UPLOAD == 1 }}
with:
name: cypress-videos
path: ${{ inputs.WORKING_DIRECTORY }}/cypress/videos
if-no-files-found: ignore