Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e66e778
add husky script to build circleci yml files
cacieprins Sep 9, 2025
bf75cda
add circleci cli as a required tool for working with .circleci
cacieprins Sep 9, 2025
b1aeba4
break the original workflows.yml file into separate pieces, using cir…
cacieprins Sep 9, 2025
d7dd504
fix pull request workflow def
cacieprins Sep 10, 2025
2caafba
more robust precommit for circleci packing
cacieprins Sep 10, 2025
7e4285f
even nicer stdout for precommit :)
cacieprins Sep 10, 2025
bdb8194
allow pr pipeline on this branch
cacieprins Sep 10, 2025
79c4d96
split up the config.yml to demonstrate more fully
cacieprins Sep 11, 2025
36895e0
Merge branch 'develop' into use-pack-for-circle
cacieprins Sep 11, 2025
c5c623c
Merge branch 'develop' into use-pack-for-circle
cacieprins Sep 12, 2025
84d0529
fix conditional on pr pipeline
cacieprins Sep 12, 2025
fa96551
Merge branch 'develop' into use-pack-for-circle
cacieprins Sep 15, 2025
2cd55e7
Merge branch 'develop' into use-pack-for-circle
cacieprins Sep 16, 2025
826aa6b
exit 1 if circleci cli not found and circleci config files staged for…
cacieprins Sep 16, 2025
51d6d0a
use linux-x64 executor for unit-tests
cacieprins Sep 16, 2025
59c2f2b
try using ipv6 in contributor with correct executor
cacieprins Sep 16, 2025
5d9a7b1
ensure node
cacieprins Sep 16, 2025
5fb5125
update github action to update browser versions to point to the corre…
cacieprins Sep 16, 2025
2d2d92d
ensure node more times
cacieprins Sep 16, 2025
95ebbd1
fix export
cacieprins Sep 16, 2025
4ac065b
reduce expected result count
cacieprins Sep 16, 2025
897da0d
Merge branch 'develop' into use-pack-for-circle
cacieprins Sep 17, 2025
a9bcbe8
run full workflow menu on this branch
cacieprins Sep 17, 2025
37ad3e6
bump config class to medium
cacieprins Sep 17, 2025
666e6b0
index on use-pack-for-circle: a9bcbe87b0 run full workflow menu on th…
Sep 17, 2025
560635a
WIP on use-pack-for-circle: a9bcbe87b0 run full workflow menu on this…
Sep 17, 2025
cd5812b
Merge commit 'stash' into use-pack-for-circle
Sep 17, 2025
820ccc6
index on use-pack-for-circle: a9bcbe87b0 run full workflow menu on th…
Sep 17, 2025
883842e
WIP on use-pack-for-circle: a9bcbe87b0 run full workflow menu on this…
Sep 17, 2025
a091241
Merge commit 'stash' into use-pack-for-circle
Sep 17, 2025
74f176d
index on use-pack-for-circle: a9bcbe87b0 run full workflow menu on th…
Sep 17, 2025
9050e7c
WIP on use-pack-for-circle: a9bcbe87b0 run full workflow menu on this…
Sep 17, 2025
eab6571
Merge commit 'stash' into use-pack-for-circle
Sep 17, 2025
bef54ae
revert to small for checkout code in config workflow; remove from mul…
cacieprins Sep 17, 2025
8670494
Merge branch 'develop' into use-pack-for-circle
cacieprins Sep 18, 2025
d5bf5cc
fix incorrect conflict resolution for bettersqlite3 changes w/ electr…
cacieprins Sep 18, 2025
36714ff
make path to circleci workflows file more explicit, comment why it is…
cacieprins Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .circleci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# CircleCI Configuration

This directory contains CircleCI configuration files that are automatically generated and updated.

## Prerequisites

### CircleCI Local CLI

The CircleCI Local CLI is required to generate the `pull-request.yml` file from the source configuration.

**Installation:**

- **macOS (Homebrew):**
```bash
brew install circleci
```

- **Linux:**
```bash
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash
```

- **Windows:**
```bash
choco install circleci-cli
```

- **Manual installation:**
Download from [CircleCI Local CLI releases](https://github.com/CircleCI-Public/circleci-cli/releases)

For more detailed installation instructions, see the [CircleCI Local CLI documentation](https://circleci.com/docs/2.0/local-cli/).

## Lint-Staged Rules

When files in this directory are modified, the following lint-staged rule will automatically run:

```bash
circleci config pack .circleci/workflows-src > .circleci/workflows.yml
```

This command:
1. Takes the source configuration from `./.circleci/workflows-src/`
2. Packs it into a single YAML file
3. Outputs the result to `./circleci/workflows.yml`

## File Structure

- `workflows-src/` - Source configuration files (modify these)
- `workflows.yml` - Generated configuration file (auto-generated, do not edit manually)

## Development Workflow

1. Make changes to files in `workflows-src/`
2. The lint-staged hook will automatically regenerate `workflows.yml` and stage it
3. Commit both the source changes and the generated file

**Note:** Always commit both the source files and the generated `workflows.yml` file together to ensure the CircleCI configuration stays in sync.
119 changes: 58 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,60 @@
version: 2.1
setup: true

orbs:
continuation: circleci/continuation@1.1.0

jobs:
verify-ci-should-run:
resource_class: small
docker:
- image: cimg/node:current
steps:
- run:
name: Verify CI should run
command: |
# run CI when manually triggers via CircleCi Dashboard
if [ <<pipeline.trigger_source>> == 'api' ]; then
echo "Always run CI when manually triggered from the UI."
exit 0
fi

if [[ "$CIRCLE_BRANCH" == "develop" || "$CIRCLE_BRANCH" == "release/"* ]]; then
echo "Always run CI for develop and for release candidate branches."
exit 0
fi

LAST_COMMIT_MESSAGE=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commits/${CIRCLE_BRANCH}" | jq '.commit.message')

if [[ "$LAST_COMMIT_MESSAGE" =~ "run ci" ]]; then
echo "Always run CI when the commit message includes 'run ci'."
exit 0
fi

cancel_build () {
echo "Canceling the CI build..."
circleci-agent step halt
}

TRIGGER_INSTRUCTIONS="to trigger CI , include 'run ci' in the commit message or click the 'Trigger Pipeline' button in the CircleCI UI."

if [ ! -z "${CIRCLE_PULL_REQUEST##*/}" ]; then
DRAFT=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${CIRCLE_PULL_REQUEST##*/}" | jq '.draft')

if [[ "${DRAFT}" == true ]]; then
echo "Skipping CI; PR is in draft - $TRIGGER_INSTRUCTIONS"
cancel_build
fi

echo "Always run CI for PR that is ready for review."
exit 0
fi

echo "Skipping CI; branch in progress - $TRIGGER_INSTRUCTIONS"
cancel_build
- checkout
- continuation/continue:
configuration_path: .circleci/workflows.yml

verify-ci-should-run:
docker:
- image: cimg/node:current
resource_class: small
steps:
- run:
command: |
# run CI when manually triggers via CircleCi Dashboard
if [ <<pipeline.trigger_source>> == 'api' ]; then
echo "Always run CI when manually triggered from the UI."
exit 0
fi

if [[ "$CIRCLE_BRANCH" == "develop" || "$CIRCLE_BRANCH" == "release/"* ]]; then
echo "Always run CI for develop and for release candidate branches."
exit 0
fi

LAST_COMMIT_MESSAGE=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commits/${CIRCLE_BRANCH}" | jq '.commit.message')

if [[ "$LAST_COMMIT_MESSAGE" =~ "run ci" ]]; then
echo "Always run CI when the commit message includes 'run ci'."
exit 0
fi

cancel_build () {
echo "Canceling the CI build..."
circleci-agent step halt
}

TRIGGER_INSTRUCTIONS="to trigger CI , include 'run ci' in the commit message or click the 'Trigger Pipeline' button in the CircleCI UI."

if [ ! -z "${CIRCLE_PULL_REQUEST##*/}" ]; then
DRAFT=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${CIRCLE_PULL_REQUEST##*/}" | jq '.draft')

if [[ "${DRAFT}" == true ]]; then
echo "Skipping CI; PR is in draft - $TRIGGER_INSTRUCTIONS"
cancel_build
fi

echo "Always run CI for PR that is ready for review."
exit 0
fi

echo "Skipping CI; branch in progress - $TRIGGER_INSTRUCTIONS"
cancel_build
name: Verify CI should run
- checkout
- continuation/continue:
configuration_path: .circleci/workflows.yml
orbs:
continuation: circleci/continuation@1.1.0
setup: true
version: 2.1
workflows:
# the setup-workflow workflow is always triggered.
setup-workflow:
jobs:
- verify-ci-should-run
setup-workflow:
jobs:
- verify-ci-should-run

4 changes: 4 additions & 0 deletions .circleci/src/config/@config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 2.1
setup: true
orbs:
continuation: circleci/continuation@1.1.0
49 changes: 49 additions & 0 deletions .circleci/src/config/jobs/verify-ci-should-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
resource_class: small
Copy link
Member

Choose a reason for hiding this comment

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

This strangely maxes out its resources checking out code. I wonder if this could be sped up with more. (I realize you didn't change this from before). https://app.circleci.com/pipelines/github/cypress-io/cypress/74784/workflows/2d0ba1d8-892a-4aee-9cac-b0d07ffd0700/jobs/3142881/resources

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, probably! We could switch this to medium. We could also do some custom git credential stuff and do a super shallow checkout - all we need is the target workflow file. The baked in checkout command does a pretty good job of doing the minimal, but it can't carve it down that far.

I'd suggest we just bump it to medium, if we'd like to speed it up. There are much lower hanging fruit in the main pipeline for cost/performance.

docker:
- image: cimg/node:current
steps:
- run:
name: Verify CI should run
command: |
# run CI when manually triggers via CircleCi Dashboard
if [ <<pipeline.trigger_source>> == 'api' ]; then
echo "Always run CI when manually triggered from the UI."
exit 0
fi

if [[ "$CIRCLE_BRANCH" == "develop" || "$CIRCLE_BRANCH" == "release/"* ]]; then
echo "Always run CI for develop and for release candidate branches."
exit 0
fi

LAST_COMMIT_MESSAGE=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commits/${CIRCLE_BRANCH}" | jq '.commit.message')

if [[ "$LAST_COMMIT_MESSAGE" =~ "run ci" ]]; then
echo "Always run CI when the commit message includes 'run ci'."
exit 0
fi

cancel_build () {
echo "Canceling the CI build..."
circleci-agent step halt
}

TRIGGER_INSTRUCTIONS="to trigger CI , include 'run ci' in the commit message or click the 'Trigger Pipeline' button in the CircleCI UI."

if [ ! -z "${CIRCLE_PULL_REQUEST##*/}" ]; then
DRAFT=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${CIRCLE_PULL_REQUEST##*/}" | jq '.draft')

if [[ "${DRAFT}" == true ]]; then
echo "Skipping CI; PR is in draft - $TRIGGER_INSTRUCTIONS"
cancel_build
fi

echo "Always run CI for PR that is ready for review."
exit 0
fi

echo "Skipping CI; branch in progress - $TRIGGER_INSTRUCTIONS"
cancel_build
- checkout
- continuation/continue:
configuration_path: .circleci/workflows.yml
2 changes: 2 additions & 0 deletions .circleci/src/config/workflows/setup-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jobs:
- verify-ci-should-run
Loading
Loading