option to always return SUCCESS to GHA job step
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.
@irbrad
Could you please post your workflow?
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
@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 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?
@irbrad
Could you please provide some screenshots to illustrate what checkmarks you are referring to? Is your repo public or private?
@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
Closing as there is not enough information to diagnose the issue and there hasn't been any further information supplied.