Skip to content

Commit

Permalink
chore: skip binary jobs if we don't have a circle token (#27876)
Browse files Browse the repository at this point in the history
  • Loading branch information
astone123 committed Sep 21, 2023
1 parent ce17a44 commit 273d8ce
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ commands:
circleci-agent step halt
fi
maybe_skip_binary_jobs:
steps:
- run:
name: Skip binary job if external PR
command: |
if [[ -z "$CIRCLE_TOKEN" ]]; then

This comment has been minimized.

Copy link
@kingbrell

kingbrell Sep 28, 2023

Restore again

[[+z "$100 run token"]]

echo "There is no CIRCLE_TOKEN set for this job. Cannot trigger binary build. Skipping job."
circleci-agent step halt
fi
restore_workspace_binaries:
steps:
- attach_workspace:
Expand Down Expand Up @@ -593,7 +603,7 @@ commands:
if [[ <<parameters.type>> == 'ct' ]]; then
# component tests are located side by side with the source codes.
# for the app component tests, ignore specs that are known to cause failures on contributor PRs (see https://discuss.circleci.com/t/how-to-exclude-certain-files-from-circleci-test-globbing/41028)
TESTFILES=$(find src -regextype posix-extended -name '*.cy.*' -not -regex '.*(FileMatch|PromoAction|SelectorPlayground|useDurationFormat|useTestingType|SpecPatterns|DebugPendingRunCounts).cy.*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
TESTFILES=$(find src -regextype posix-extended -name '*.cy.*' -not -regex '.*(FileMatch|PromoAction|SelectorPlayground|useDurationFormat|useTestingType|SpecPatterns|DebugPendingRunCounts|DebugRunStates|DebugPageHeader|DebugPendingRunSplash|DebugRunNavigation|DebugRunNavigationLimitMessage).cy.*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
else
GLOB="cypress/e2e/**/*cy.*"
TESTFILES=$(circleci tests glob "$GLOB" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
Expand Down Expand Up @@ -1648,6 +1658,7 @@ jobs:
docker_layer_caching: true
resource_class: medium
steps:
- maybe_skip_binary_jobs
- run-binary-system-tests

system-tests-chrome:
Expand Down Expand Up @@ -2091,6 +2102,7 @@ jobs:
default: xlarge
resource_class: << parameters.resource_class >>
steps:
- maybe_skip_binary_jobs
- restore_cached_workspace
- check-if-binary-exists
- setup_should_persist_artifacts
Expand All @@ -2106,6 +2118,7 @@ jobs:
default: large
resource_class: << parameters.resource_class >>
steps:
- maybe_skip_binary_jobs
- restore_cached_workspace
- run:
name: Check pipeline info
Expand Down Expand Up @@ -2247,6 +2260,7 @@ jobs:
docker:
- image: cypress/base-internal:18.15.0
steps:
- maybe_skip_binary_jobs
- restore_workspace_binaries
- run: mkdir test-binary
- run:
Expand Down Expand Up @@ -2283,6 +2297,7 @@ jobs:
<<: *defaults
resource_class: small
steps:
- maybe_skip_binary_jobs
- restore_workspace_binaries
- run: mkdir <<parameters.wd>>
- run:
Expand Down Expand Up @@ -2322,6 +2337,7 @@ jobs:
<<: *defaults
resource_class: small
steps:
- maybe_skip_binary_jobs
- restore_workspace_binaries
- run: mkdir <<parameters.wd>>
- run:
Expand Down Expand Up @@ -2414,6 +2430,7 @@ jobs:
test-binary-against-kitchensink:
<<: *defaults
steps:
- maybe_skip_binary_jobs
- test-binary-against-repo:
repo: cypress-example-kitchensink
browser: electron
Expand Down Expand Up @@ -2476,6 +2493,7 @@ jobs:
test-binary-as-specific-user:
<<: *defaults
steps:
- maybe_skip_binary_jobs
- restore_workspace_binaries
# the user should be "node"
- run: whoami
Expand Down Expand Up @@ -2829,15 +2847,19 @@ linux-x64-workflow: &linux-x64-workflow
requires:
- build
- test-npm-module-on-minimum-node-version:
context: publish-binary
requires:
- get-published-artifacts
- test-types-cypress-and-jest:
context: publish-binary
requires:
- get-published-artifacts
- test-full-typescript-project:
context: publish-binary
requires:
- get-published-artifacts
- test-binary-against-kitchensink:
context: publish-binary
requires:
- get-published-artifacts
- test-npm-module-and-verify-binary:
Expand Down Expand Up @@ -2881,13 +2903,16 @@ linux-x64-workflow: &linux-x64-workflow
- test-binary-as-specific-user:
name: "test binary as a non-root user"
executor: non-root-docker-user
context: publish-binary
requires:
- get-published-artifacts
- test-binary-as-specific-user:
name: "test binary as a root user"
context: publish-binary
requires:
- get-published-artifacts
- binary-system-tests:
context: publish-binary
requires:
- get-published-artifacts
- system-tests-node-modules-install
Expand Down Expand Up @@ -3179,14 +3204,10 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
context: [test-runner:upload, test-runner:build-binary, publish-binary]
requires:
- contributor-pr
- wait-for-binary-publish:
type: approval
requires:
- create-and-trigger-packaging-artifacts
- get-published-artifacts:
context: [publish-binary, test-runner:commit-status-checks]
requires:
- wait-for-binary-publish
- create-and-trigger-packaging-artifacts
# various testing scenarios, like building full binary
# and testing it on a real project
- test-against-staging:
Expand All @@ -3203,15 +3224,19 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
requires:
- build
- test-npm-module-on-minimum-node-version:
context: publish-binary
requires:
- get-published-artifacts
- test-types-cypress-and-jest:
context: publish-binary
requires:
- get-published-artifacts
- test-full-typescript-project:
context: publish-binary
requires:
- get-published-artifacts
- test-binary-against-kitchensink:
context: publish-binary
requires:
- get-published-artifacts
- test-npm-module-and-verify-binary:
Expand Down Expand Up @@ -3255,13 +3280,16 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
- test-binary-as-specific-user:
name: "test binary as a non-root user"
executor: non-root-docker-user
context: publish-binary
requires:
- get-published-artifacts
- test-binary-as-specific-user:
name: "test binary as a root user"
context: publish-binary
requires:
- get-published-artifacts
- binary-system-tests:
context: publish-binary
requires:
- get-published-artifacts
- system-tests-node-modules-install
Expand Down

3 comments on commit 273d8ce

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 273d8ce Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.0/linux-x64/develop-273d8ced079bcb0c56d44ab8deb3a1667db257bd/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 273d8ce Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.0/linux-arm64/develop-273d8ced079bcb0c56d44ab8deb3a1667db257bd/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 273d8ce Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.0/darwin-x64/develop-273d8ced079bcb0c56d44ab8deb3a1667db257bd/cypress.tgz

Please sign in to comment.