Skip to content

Commit 98eca61

Browse files
authored
Allow skipping checkout in install and run (#490)
* Allow skipping the `checkout` command in `commands/install` and `jobs/run` * Add CI verification * Fix typo Signed-off-by: Timo Sand <[email protected]> --------- Signed-off-by: Timo Sand <[email protected]>
1 parent b8ebfb6 commit 98eca61

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

.circleci/test-deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ workflows:
120120
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/angular-app/package.json" }}
121121
cypress-command: "npx cypress run --component --parallel --record"
122122
parallelism: 3
123+
- cypress/run:
124+
filters: *filters
125+
name: Verify skip-checkout
126+
working-directory: examples/angular-app
127+
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/angular-app/package.json" }}
128+
cypress-command: "npx cypress run --component --parallel --record"
129+
pre-steps:
130+
- checkout
123131
- install-and-persist:
124132
filters: *filters
125133
name: Install & Persist
@@ -159,6 +167,7 @@ workflows:
159167
- Run CT Tests in Chrome
160168
- Run CT Tests in Firefox
161169
- Run CT Tests in Edge
170+
- Verify skip-checkout
162171
context: circleci-orb-publishing
163172
filters:
164173
branches:

src/commands/install.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ parameters:
4848
enum: ["npm", "yarn", "yarn-berry", "pnpm"]
4949
default: "npm"
5050
description: Select the default node package manager to use. NPM v5+ Required.
51+
skip-checkout:
52+
type: boolean
53+
default: false
54+
description: Allow skipping the `checkout` command
5155

5256
steps:
53-
- checkout
57+
- unless:
58+
condition: << parameters.skip-checkout >>
59+
steps:
60+
- checkout
5461
- when:
5562
condition: << parameters.install-browsers >>
5663
steps:

src/jobs/run.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ parameters:
7373
default: "18.16.1" # keep in sync with executors/default.yml
7474
description: >
7575
The version of Node to run your tests with.
76+
skip-checkout:
77+
type: boolean
78+
default: false
79+
description: Whether to skip code checkout
7680

7781
steps:
7882
- install:
@@ -85,6 +89,7 @@ steps:
8589
package-manager: << parameters.package-manager >>
8690
include-branch-in-node-cache-key: << parameters.include-branch-in-node-cache-key >>
8791
install-browsers: << parameters.install-browsers >>
92+
skip-checkout: << parameters.skip-checkout >>
8893
- run-tests:
8994
working-directory: << parameters.working-directory >>
9095
start-command: << parameters.start-command >>

0 commit comments

Comments
 (0)