-
Notifications
You must be signed in to change notification settings - Fork 358
Expand file tree
/
Copy pathexample-start-and-pnpm-workspaces.yml
More file actions
110 lines (99 loc) · 3.44 KB
/
example-start-and-pnpm-workspaces.yml
File metadata and controls
110 lines (99 loc) · 3.44 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
99
100
101
102
103
104
105
106
107
108
109
110
name: example-start-and-pnpm-workspaces
# In the example jobs, the action is called with
# uses: ./
# which runs the action code from the current branch.
# If you copy this workflow to another repo, replace the line with
# uses: cypress-io/github-action@v7
on:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:
jobs:
# The example has pnpm workspaces in its "root" folder
# examples/start-and-pnpm-workspaces
single-ws:
# This job installs pnpm,
# installs all dependencies,
# then runs Cypress tests in the single workspace
# of the subfolder "packages/workspace-1".
runs-on: ubuntu-24.04
name: Single workspace
steps:
- name: Checkout repository
uses: actions/checkout@v6
# See https://github.com/pnpm/action-setup
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: 10
# See https://github.com/actions/setup-node
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
cache: pnpm
cache-dependency-path: examples/start-and-pnpm-workspaces/pnpm-lock.yaml
- name: Install dependencies
# All dependencies including workspaces are installed
uses: ./
with:
package-manager-cache: false
runTests: false
working-directory: examples/start-and-pnpm-workspaces
- name: Cypress test Single
# Run Cypress in examples/start-and-pnpm-workspaces/packages/workspace-1 only
uses: ./
with:
# Do not attempt to install dependencies in the workspace using the action.
# There is no pnpm-lock.yaml file in a workspace for
# Cypress GitHub Action to use.
# We already installed dependencies previously.
install: false
working-directory: examples/start-and-pnpm-workspaces/packages/workspace-1
build: pnpm run build
start: pnpm start
wait-on: 'http://localhost:5000'
multiple-ws:
# This job installs pnpm,
# installs all dependencies,
# then runs Cypress tests in each of the workspaces.
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
cypress:
- working_directory: examples/start-and-pnpm-workspaces/packages/workspace-1
- working_directory: examples/start-and-pnpm-workspaces/packages/workspace-2
name: Multiple workspaces
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: 10
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
cache: pnpm
cache-dependency-path: examples/start-and-pnpm-workspaces/pnpm-lock.yaml
- name: Install dependencies
uses: ./
with:
package-manager-cache: false
runTests: false
working-directory: examples/start-and-pnpm-workspaces
- name: Cypress test Multiple
# Run Cypress in
# examples/start-and-pnpm-workspaces/packages/workspace-1 and
# examples/start-and-pnpm-workspaces/packages/workspace-2
uses: ./
with:
install: false
working-directory: ${{ matrix.cypress.working_directory }}
build: pnpm run build
start: pnpm start
wait-on: 'http://localhost:5000'