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

option to always return SUCCESS to GHA job step #1237

Closed
irbrad opened this issue Aug 23, 2024 · 7 comments
Closed

option to always return SUCCESS to GHA job step #1237

irbrad opened this issue Aug 23, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@irbrad
Copy link

irbrad commented Aug 23, 2024

I have a suite of tests that are acceptable if they fail and I'd like to have always have a green bubble on that actions job step to remove confusion of what appears to be a failing step. Would it be possible (or does this already exist) to always return a SUCCESS? I think Actions is picking up the text "Error" in the log output and changing that to a ❌.

My current workaround is just to name the Actions job as "nonblocking" but it seems like there should be a better way to do this.

@MikeMcC399
Copy link
Collaborator

@irbrad

Could you please post your workflow?

@MikeMcC399 MikeMcC399 added the question Further information is requested label Aug 23, 2024
@irbrad
Copy link
Author

irbrad commented Aug 23, 2024

Could you please post your workflow?

The Cypress portion of the workflow is as follows. This area of the workflow does have continue-on-error enabled. new_desktop_run_tests is generated with a bash step that searches for specific tags in the specs using cypress-grep. The action step isn't necessarily blocking deployments but it appears like it is. These are new tests that we are inserting into our CI process that need to be proved out before we move them into a position that they can block the deployment pipeline.

      - name: ${{ 'test pr-${{ github.event.number }} ${{needs.prep.outputs.short_sha}}' }}
        uses: cypress-io/github-action@v6
        with:
          working-directory: ./test
          browser: chrome
          record: ${{ inputs.record }}
          parallel: true
          install: false
          runTests: ${{ needs.prep.outputs.new_desktop_run_tests }}
          group: "Integration - Chrome - Desktop"
          spec: ${{ needs.prep.outputs.new_desktop_files }}
          config: '{"e2e": { "excludeSpecPattern": "cypress/integration/**/*.skip-ci.spec.js" } }'
          tag: ${{ inputs.cypress-cloud-base-tag }}
          ci-build-id: "${{ inputs.ci-build-id }}-new"
          publish-summary: false

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Aug 25, 2024

@irbrad

Please refer to the GitHub Actions documentation steps context together with jobs.<job_id>.steps[*].continue-on-error

When a continue-on-error step fails, the outcome is failure, but the final conclusion is success.

This is standard functionality of the GitHub runner and you should be able to use this to meet your requirements.

You can also use if: ${{ always() }} to execute a step even if the previous step failed.

@MikeMcC399 MikeMcC399 self-assigned this Aug 25, 2024
@irbrad
Copy link
Author

irbrad commented Aug 26, 2024

@MikeMcC399 Thanks for the response!

That's actually how I'm already running (both continue-on-error and always()) it but because the action throws a failure even though it continues it's still not lighting up the merge button on PR's even though it's actually functional. It's more confusing than anything else. Is there a way to force Cypress to not error out in the log file so that the action finishes cleanly (so green checkmark) even though the tests might have failed?

@MikeMcC399
Copy link
Collaborator

@irbrad

Could you please provide some screenshots to illustrate what checkmarks you are referring to? Is your repo public or private?

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Aug 27, 2024

@irbrad

I'm wondering if your problem is with the Cypress Cloud GitHub Integration. Screenshots would help to clarify.

Note that Cypress Cloud support is available through https://www.cypress.io/support

@MikeMcC399
Copy link
Collaborator

Closing as there is not enough information to diagnose the issue and there hasn't been any further information supplied.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants