forked from cypress-io/cypress-docker-images
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample-cypress-github-action.yml
More file actions
98 lines (93 loc) · 3.51 KB
/
example-cypress-github-action.yml
File metadata and controls
98 lines (93 loc) · 3.51 KB
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
90
91
92
93
94
95
96
97
98
name: Example Cypress GitHub Actions
# This example workflow demonstrates
# GitHub Actions (https://docs.github.com/en/actions) using the
# Cypress JavaScript GitHub Action (https://github.com/cypress-io/github-action) with
# Cypress Docker images (https://github.com/cypress-io/cypress-docker-images)
# To automatically trigger a workflow, for instance on a push event, see
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
# for options and examples.
# The workflow can be triggered manually on demand, see
# https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
on:
push:
paths:
- '.github/workflows/example-cypress-github-action.yml'
pull_request:
paths:
- '.github/workflows/example-cypress-github-action.yml'
workflow_dispatch:
jobs:
docker-base:
runs-on: ubuntu-24.04
container:
# Examples use latest tag
# For production use, to avoid the risk of breaking changes,
# choose a fixed version tag from
# https://hub.docker.com/r/cypress/base/tags
image: cypress/base:latest
# User 1001 matches the owner of the HOME directory which GitHub Actions creates
# Selecting the same user minimizes permissions issues
options: --user 1001
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
- uses: cypress-io/github-action@v7
with:
# Only the Electron browser is available with cypress/base
# This is the default browser and does not need to be specified
working-directory: examples/basic
docker-browsers:
runs-on: ubuntu-24.04
strategy:
# Makes sure that each browser test runs, even if any other test fails
fail-fast: false
matrix:
browser: [chrome, edge, firefox]
container:
# Examples use latest tag
# For production use, to avoid the risk of breaking changes,
# choose a fixed version tag from
# https://hub.docker.com/r/cypress/browser/tags
image: cypress/browsers:latest
options: --user 1001
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
- uses: cypress-io/github-action@v7
with:
working-directory: examples/basic
browser: ${{ matrix.browser }}
docker-included:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
browser: [chrome, edge, firefox]
# from https://hub.docker.com/r/cypress/included/tags
container:
# Examples use latest tag
# For production use, to avoid the risk of breaking changes,
# choose a fixed version tag from
# https://hub.docker.com/r/cypress/included/tags
image: cypress/included:latest
options: --user 1001
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
- uses: cypress-io/github-action@v7
with:
# Using Cypress project with no Cypress version pre-installed
working-directory: examples/basic-mini
browser: ${{ matrix.browser }}
env:
# Cypress binary is already installed in cypress/included image
# Use CYPRESS_INSTALL_BINARY=0 to prevent unneeded caching
# which can cause errors with non-root user
# see https://on.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0