forked from cypress-io/github-action
-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (99 loc) · 3.43 KB
/
example-start-and-pnpm-workspaces.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: example-start-and-pnpm-workspaces
on:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:
jobs:
single:
# the example has pnpm workspace in its "root" folder
# examples/start-and-pnpm-workspaces
# and tests in a subfolder like "workspace-1"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Set up pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/start-and-pnpm-workspaces/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Set up Cypress binary cache
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('examples/start-and-pnpm-workspaces/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-cypress-
- run: pnpm install --frozen-lockfile
working-directory: examples/start-and-pnpm-workspaces
- name: Test workspace-1
uses: ./
with:
working-directory: examples/start-and-pnpm-workspaces/workspace-1
install: false
build: pnpm run build
start: pnpm start
wait-on: 'http://localhost:5000'
multiple:
# example with web application build,
# server start and waiting for the server
# to respond before running tests
# in each pnpm workspaces subfolder
runs-on: ubuntu-22.04
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Cypress Cloud hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
cypress:
- working_directory: examples/start-and-pnpm-workspaces/workspace-1
- working_directory: examples/start-and-pnpm-workspaces/workspace-2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Set up pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/start-and-pnpm-workspaces/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Set up Cypress binary cache
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('examples/start-and-pnpm-workspaces/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-cypress-
- run: pnpm install --frozen-lockfile
working-directory: examples/start-and-pnpm-workspaces
- name: Test multiple
uses: ./
with:
working-directory: ${{ matrix.cypress.working_directory }}
install: false
build: pnpm run build
start: pnpm start
wait-on: 'http://localhost:5000'