Skip to content

Commit

Permalink
Add alternative way to enable corepack (#233)
Browse files Browse the repository at this point in the history
* Add alternative location to corepack location

* Add extra test

* Update cache key
  • Loading branch information
marboledacci authored Oct 10, 2024
1 parent 81e9c2d commit b9fc910
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
40 changes: 28 additions & 12 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ jobs:
app-dir: "~/project/sample"
- run: yarn --version
- run: cd ~/project/sample && yarn test
integration-test-yarn-berry-nocimg:
environment:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
docker:
- image: cypress/browsers
steps:
- checkout
- run: mv ~/project/sample/package-berry.json ~/project/sample/package.json
- node/install-packages:
pkg-manager: yarn-berry
cache-version: yarn-berry-v2
app-dir: "~/project/sample"
override-ci-command: yarn install
- run: cd ~/project/sample && yarn test
integration-test-yarn-berry:
environment:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
Expand Down Expand Up @@ -224,7 +238,7 @@ workflows:
filters: *filters
name: node-npm-jest-test-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: jest
setup:
- run:
Expand All @@ -236,7 +250,7 @@ workflows:
filters: *filters
name: node-yarn-jest-test-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: jest
pkg-manager: yarn
setup:
Expand All @@ -249,7 +263,7 @@ workflows:
filters: *filters
name: node-pnpm-jest-test-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: jest
pkg-manager: pnpm
setup:
Expand All @@ -262,7 +276,7 @@ workflows:
filters: *filters
name: node-npm-mocha-test-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: mocha
run-command: testmocha
setup:
Expand All @@ -275,7 +289,7 @@ workflows:
filters: *filters
name: node-yarn-mocha-test-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: mocha
pkg-manager: yarn
run-command: testmocha
Expand All @@ -289,7 +303,7 @@ workflows:
filters: *filters
name: node-pnpm-mocha-test-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: mocha
pkg-manager: pnpm
run-command: testmocha
Expand All @@ -303,7 +317,7 @@ workflows:
filters: *filters
name: node-yarn-mocha-with-test-result-path-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-for: mocha
pkg-manager: yarn
run-command: testmocha
Expand All @@ -318,7 +332,7 @@ workflows:
filters: *filters
name: node-test-results-file-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
test-results-path: sample/other-junit.xml
setup:
- run:
Expand All @@ -330,7 +344,7 @@ workflows:
filters: *filters
name: node-test-no-junit
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
setup:
- run:
name: Remove other lock files
Expand All @@ -341,14 +355,14 @@ workflows:
filters: *filters
name: node-test-with-coverage
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
run-command: "test:coverage"
test-coverage-path: ~/project/sample/coverage
- node/run:
filters: *filters
name: node-run-npm-job
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
npm-run: build
setup:
- run:
Expand All @@ -373,7 +387,7 @@ workflows:
filters: *filters
name: node-run-upload-artifacts
app-dir: "~/project/sample"
cache-version: v4
cache-version: v1
npm-run: build
artifacts-path: "~/project/sample/dist"
- node/run:
Expand All @@ -399,6 +413,8 @@ workflows:
filters: *filters
- integration-test-yarn-berry:
filters: *filters
- integration-test-yarn-berry-nocimg:
filters: *filters
- orb-tools/pack:
filters: *release-filters
- orb-tools/publish:
Expand Down
5 changes: 4 additions & 1 deletion src/scripts/packages/yarn-berry-install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
corepack enable --install-directory ~/bin
if ! corepack enable; then
echo "Using alternative corepack location"
corepack enable --install-directory ~/bin
fi
# Run override ci command if provided, otherwise run default yarn install
# See: https://yarnpkg.com/configuration/yarnrc/#cacheFolder
if [[ -n "$PARAM_CACHE_PATH" ]]; then
Expand Down

0 comments on commit b9fc910

Please sign in to comment.