Skip to content

Commit 4996a77

Browse files
committed
chore: add examples for pnpm
. .
1 parent 53cc317 commit 4996a77

File tree

9 files changed

+2420
-0
lines changed

9 files changed

+2420
-0
lines changed
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
name: example-basic
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
pull_request:
7+
jobs:
8+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cypress v9 and lower ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
9+
10+
basic-pnpm-ubuntu-18:
11+
runs-on: ubuntu-18.04
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v2
18+
with:
19+
version: latest
20+
21+
- name: Cypress tests
22+
# normally you would write
23+
# uses: cypress-io/github-action@v2
24+
uses: ./
25+
# the parameters below are only necessary
26+
# because we are running these examples in a monorepo
27+
with:
28+
working-directory: examples/v9/basic-pnpm
29+
# just for full picture after installing Cypress
30+
# print information about detected browsers, etc
31+
# see https://on.cypress.io/command-line#cypress-info
32+
build: npx cypress info
33+
34+
basic-pnpm-ubuntu-20:
35+
runs-on: ubuntu-20.04
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
40+
- name: Install pnpm
41+
uses: pnpm/action-setup@v2
42+
with:
43+
version: latest
44+
45+
- name: Cypress tests
46+
uses: ./
47+
with:
48+
working-directory: examples/v9/basic-pnpm
49+
build: npx cypress info
50+
51+
basic-pnpm-on-windows:
52+
runs-on: windows-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
57+
- name: Install pnpm
58+
uses: pnpm/action-setup@v2
59+
with:
60+
version: latest
61+
62+
- name: Cypress tests
63+
uses: ./
64+
with:
65+
working-directory: examples/v9/basic-pnpm
66+
build: npx cypress info
67+
68+
basic-pnpm-on-mac:
69+
runs-on: macos-latest
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v2
73+
74+
- name: Install pnpm
75+
uses: pnpm/action-setup@v2
76+
with:
77+
version: latest
78+
79+
- name: Cypress tests
80+
uses: ./
81+
with:
82+
working-directory: examples/v9/basic-pnpm
83+
build: npx cypress info
84+
85+
# skips the binary installation
86+
# shows that the job should not fail
87+
# https://github.com/cypress-io/github-action/issues/327
88+
basic-pnpm-without-binary-install:
89+
runs-on: ubuntu-20.04
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v2
93+
94+
- name: Install pnpm
95+
uses: pnpm/action-setup@v2
96+
with:
97+
version: latest
98+
99+
- name: Cypress tests
100+
uses: ./
101+
with:
102+
working-directory: examples/v9/basic-pnpm
103+
# since we do not install Cypress
104+
# we should not attempt to run tests
105+
runTests: false
106+
env:
107+
# skip the binary install
108+
CYPRESS_INSTALL_BINARY: 0
109+
110+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cypress v10 and higher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
111+
112+
basic-pnpm-ubuntu-18-v10:
113+
runs-on: ubuntu-18.04
114+
steps:
115+
- name: Checkout
116+
uses: actions/checkout@v2
117+
118+
- name: Install pnpm
119+
uses: pnpm/action-setup@v2
120+
with:
121+
version: latest
122+
123+
- name: Cypress tests
124+
# normally you would write
125+
# uses: cypress-io/github-action@v2
126+
uses: ./
127+
# the parameters below are only necessary
128+
# because we are running these examples in a monorepo
129+
with:
130+
working-directory: examples/v10/basic-pnpm
131+
# just for full picture after installing Cypress
132+
# print information about detected browsers, etc
133+
# see https://on.cypress.io/command-line#cypress-info
134+
build: npx cypress info
135+
136+
basic-pnpm-ubuntu-20-v10:
137+
runs-on: ubuntu-20.04
138+
steps:
139+
- name: Checkout
140+
uses: actions/checkout@v2
141+
142+
- name: Install pnpm
143+
uses: pnpm/action-setup@v2
144+
with:
145+
version: latest
146+
147+
- name: Cypress tests
148+
uses: ./
149+
with:
150+
working-directory: examples/v10/basic-pnpm
151+
build: npx cypress info
152+
153+
basic-pnpm-on-windows-v10:
154+
runs-on: windows-latest
155+
steps:
156+
- name: Checkout
157+
uses: actions/checkout@v2
158+
159+
- name: Install pnpm
160+
uses: pnpm/action-setup@v2
161+
with:
162+
version: latest
163+
164+
- name: Cypress tests
165+
uses: ./
166+
with:
167+
working-directory: examples/v10/basic-pnpm
168+
build: npx cypress info
169+
170+
basic-pnpm-on-mac-v10:
171+
runs-on: macos-latest
172+
steps:
173+
- name: Checkout
174+
uses: actions/checkout@v2
175+
176+
- name: Install pnpm
177+
uses: pnpm/action-setup@v2
178+
with:
179+
version: latest
180+
181+
- name: Cypress tests
182+
uses: ./
183+
with:
184+
working-directory: examples/v10/basic-pnpm
185+
build: npx cypress info
186+
187+
# skips the binary installation
188+
# shows that the job should not fail
189+
# https://github.com/cypress-io/github-action/issues/327
190+
basic-pnpm-without-binary-install-v10:
191+
runs-on: ubuntu-20.04
192+
steps:
193+
- name: Checkout
194+
uses: actions/checkout@v2
195+
196+
- name: Install pnpm
197+
uses: pnpm/action-setup@v2
198+
with:
199+
version: latest
200+
201+
- name: Cypress tests
202+
uses: ./
203+
with:
204+
working-directory: examples/v10/basic-pnpm
205+
# since we do not install Cypress
206+
# we should not attempt to run tests
207+
runTests: false
208+
env:
209+
# skip the binary install
210+
CYPRESS_INSTALL_BINARY: 0
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
fixturesFolder: false,
5+
e2e: {
6+
setupNodeEvents(on, config) {},
7+
supportFile: false,
8+
},
9+
})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
it('works', () => {
2+
expect(42).to.equal(21 + 21)
3+
cy.visit('https://example.cypress.io').then(() => {
4+
expect('hello').to.equal('hello')
5+
})
6+
})

examples/v10/basic-pnpm/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "example-basic",
3+
"version": "1.0.0",
4+
"description": "basic example how to run Cypress tests",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "cypress run"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"private": true,
12+
"devDependencies": {
13+
"cypress": "^10.0.0"
14+
}
15+
}

0 commit comments

Comments
 (0)