-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab05d0e
commit c543817
Showing
10 changed files
with
72 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,27 @@ | ||
version: 2.1 | ||
setup: true | ||
orbs: | ||
orb-tools: circleci/[email protected] | ||
shellcheck: circleci/[email protected] | ||
|
||
orb-tools: circleci/[email protected] | ||
shellcheck: circleci/[email protected] | ||
filters: &filters | ||
tags: | ||
only: /.*/ | ||
workflows: | ||
lint-pack: | ||
jobs: | ||
- orb-tools/lint: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
- orb-tools/pack: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
- orb-tools/review: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
exclude: RC010 | ||
filters: *filters | ||
- shellcheck/check: | ||
exclude: SC2148,SC2038,SC2086,SC2002,SC2016 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- orb-tools/publish: | ||
orb-name: circleci/node | ||
vcs-type: << pipeline.project.type >> | ||
requires: | ||
[orb-tools/lint, orb-tools/review, orb-tools/pack, shellcheck/check] | ||
# Use a context to hold your publishing token. | ||
github-token: GHI_TOKEN | ||
context: orb-publisher | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
# Triggers the next workflow in the Orb Development Kit. | ||
- orb-tools/continue: | ||
pipeline-number: << pipeline.number >> | ||
vcs-type: << pipeline.project.type >> | ||
requires: [orb-tools/publish] | ||
filters: | ||
tags: | ||
only: /.*/ | ||
orb_name: node | ||
pipeline_number: << pipeline.number >> | ||
vcs_type: << pipeline.project.type >> | ||
requires: [orb-tools/lint, orb-tools/review, orb-tools/pack, shellcheck/check] | ||
filters: *filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
version: 2.1 | ||
orbs: | ||
node: circleci/node@dev:<<pipeline.git.revision>> | ||
orb-tools: circleci/[email protected] | ||
jq: circleci/[email protected] | ||
commands: | ||
check-uploaded-test-results: | ||
parameters: | ||
job-name: | ||
type: string | ||
expected-tests: | ||
type: integer | ||
steps: | ||
- run: | ||
name: check for << parameters.job-name >> test results | ||
command: | | ||
export TEST_JOB_NUMBER=$(jq '.items[] | select(.name == "<< parameters.job-name >>") | .job_number' workflow.json) | ||
curl --request GET \ | ||
--url https://circleci.com/api/v2/project/gh/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$TEST_JOB_NUMBER/tests \ | ||
--header 'authorization: Basic $CIRCLE_TOKEN' \ | ||
| jq '.items | length | if . != << parameters.expected-tests >> then halt_error else . end' | ||
node: {} | ||
orb-tools: circleci/[email protected] | ||
jq: circleci/[email protected] | ||
filters: &filters | ||
tags: | ||
only: /.*/ | ||
release-filters: &release-filters | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ | ||
|
||
executors: | ||
linux: | ||
docker: | ||
- image: cimg/base:stable | ||
macos: | ||
macos: | ||
xcode: 13.2.0 | ||
xcode: 15.1.0 | ||
machine: | ||
machine: | ||
image: ubuntu-2004:202111-01 | ||
|
@@ -150,109 +143,54 @@ jobs: | |
app-dir: "~/project/sample" | ||
- run: cd ~/project/sample && yarn test | ||
|
||
check-test-results-uploaded: | ||
executor: | ||
name: node/default | ||
steps: | ||
- jq/install | ||
- run: | ||
name: fetch workflow | ||
command: | | ||
curl --request GET \ | ||
--url https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job \ | ||
--header 'authorization: Basic $CIRCLE_TOKEN' > workflow.json | ||
- check-uploaded-test-results: | ||
job-name: node-npm-jest-test-job | ||
expected-tests: 1 | ||
- check-uploaded-test-results: | ||
job-name: node-yarn-jest-test-job | ||
expected-tests: 1 | ||
- check-uploaded-test-results: | ||
job-name: node-test-results-file-job | ||
expected-tests: 1 | ||
- check-uploaded-test-results: | ||
job-name: node-npm-mocha-test-job | ||
expected-tests: 1 | ||
- check-uploaded-test-results: | ||
job-name: node-yarn-mocha-test-job | ||
expected-tests: 1 | ||
|
||
workflows: | ||
test-deploy: | ||
jobs: | ||
- orb-tools/lint: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- orb-tools/pack: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- orb-tools/review: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- integration-test-install-specified-version: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
matrix: | ||
parameters: | ||
os: [linux, macos, machine] | ||
- integration-test-install-latest: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
matrix: | ||
parameters: | ||
os: [linux, macos, machine] | ||
- integration-test-install-lts: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
matrix: | ||
parameters: | ||
os: [linux, macos, machine] | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-npm-jest-test-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
test-results-for: jest | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-yarn-jest-test-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
test-results-for: jest | ||
pkg-manager: yarn | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-npm-mocha-test-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
test-results-for: mocha | ||
run-command: testmocha | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-yarn-mocha-test-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
test-results-for: mocha | ||
pkg-manager: yarn | ||
run-command: testmocha | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-yarn-mocha-with-test-result-path-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
|
@@ -261,83 +199,52 @@ workflows: | |
run-command: testmocha | ||
test-results-path: sample/test-results.xml | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-test-results-file-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
test-results-path: sample/other-junit.xml | ||
- node/test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-test-no-junit | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
- check-test-results-uploaded: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
requires: | ||
- node-npm-jest-test-job | ||
- node-yarn-jest-test-job | ||
- node-npm-mocha-test-job | ||
- node-yarn-mocha-test-job | ||
- node-test-results-file-job | ||
- node/run: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-run-npm-job | ||
app-dir: "~/project/sample" | ||
cache-version: v4 | ||
npm-run: build | ||
- node/run: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
name: node-run-yarn-job | ||
app-dir: "~/project/sample" | ||
cache-version: v5 | ||
pkg-manager: yarn | ||
yarn-run: build | ||
- integration-test-override-ci: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
- integration-test-override-ci-windows: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
- integration-test-yarn: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
- integration-test-yarn-berry: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
filters: *filters | ||
- orb-tools/pack: | ||
filters: *release-filters | ||
- orb-tools/publish: | ||
orb-name: circleci/node | ||
vcs-type: << pipeline.project.type >> | ||
pub-type: production | ||
orb_name: circleci/node | ||
vcs_type: << pipeline.project.type >> | ||
pub_type: production | ||
requires: | ||
- orb-tools/lint | ||
- orb-tools/review | ||
- orb-tools/pack | ||
- integration-test-install-specified-version | ||
- integration-test-install-latest | ||
- integration-test-install-lts | ||
- check-test-results-uploaded | ||
- node-yarn-mocha-with-test-result-path-job | ||
- node-test-results-file-job | ||
- node-run-npm-job | ||
- node-run-yarn-job | ||
github-token: GHI_TOKEN | ||
github_token: GHI_TOKEN | ||
context: orb-publisher | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ | ||
filters: *release-filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi | ||
|
||
# FUNCTIONS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Fail if package.json does not exist in working directory | ||
|
||
if [ ! -f "package.json" ]; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ "$ORB_PARAM_PKG_MANAGER" == "npm" ]]; then | ||
npm run "$ORB_PARAM_NPM_RUN" | ||
else | ||
|