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

Skip ahead to re-run only Cypress #1885

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 1 addition & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,6 @@ jobs:
echo $endpoint
echo "storybook-endpoint=$endpoint" >> "$GITHUB_OUTPUT"

- name: Generate unique ID for Cypress
id: uuid
run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> "$GITHUB_OUTPUT"

end-deployment:
needs: [begin-deployment, deploy-app, finishing-prep]
if: always() && needs.begin-deployment.result == 'success'
Expand Down Expand Up @@ -491,7 +487,7 @@ jobs:
parallel: true
browser: chrome
group: 'Chrome'
ci-build-id: ${{ needs.finishing-prep.outputs.cypress-uuid }}
ci-build-id: ${{ github.run_id }}-${{ github.run_attempt }}
# Point to the cypress config file from root
config-file: services/cypress/cypress.config.ts
env:
Expand Down
8 changes: 8 additions & 0 deletions scripts/get-changed-services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ async function main() {
// get the latest commit in the branch to see if we are forcing a run
const latestCommit = await getLatestCommitSHA()
const commitMessage = await getLatestCommitMessage(latestCommit)

// force a complete CI run
if (commitMessage.includes('ci-force-run')) {
core.setOutput('changed-services', deployAllServices)
return
}

// force just a cypress re-run
if (commitMessage.includes('cypress re-run')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know about ci-force-run, where would be a good place to document these CI incantations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The force-ci-run is in the main Readme, but it looks like it's a little buried and hard to pick out. I just pushed up a change that documents the new cypress re-run and breaks those docs out into a section so it's easier to run across!

core.setOutput('changed-services', [])
return
}

// if we haven't had a run on this branch, we need to deploy everything
if (allWorkflowRuns.data.total_count === 0) {
core.setOutput('changed-services', deployAllServices)
Expand Down
Loading