Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 6

How to allow a special workflows actions matrix combination to fail?

Assuming that I found a bug where py38 is broken under OSX and I want to allow this job to fail until it is fixed (upstream reasons).

 

How do I do this on GitHub Actions?

 

Current configuration at https://github.com/ansible/ansible-lint/blob/master/.github/workflows/tox-tests.yml#L24

 

5 Replies
Pilot Lvl 1
Message 2 of 6

Re: How to allow a special workflows actions matrix combination to fail?

Add an if clause to the job?

 

if: matrix.python-version != '3.8' && matrix.os != macOS-10.14

GitHub Partner
Message 3 of 6

Re: How to allow a special workflows actions matrix combination to fail?

Hi ssbarnea,

 

Thanks for your feedback!

 

You can skip this combination (py38+osx) directly with the 'exclude' option, code as below:

 

    exclude:

      # excludes py38 on OSX

      - os: macos-10.14

        python-version: 3.8

 

As screenshot shows, combination(py38+osx) is excluded.  After you fix the py38 broken error, you can remove the exclude option to add combination back.

 

Combination.png

Highlighted
Copilot Lvl 3
Message 4 of 6

Re: How to allow a special workflows actions matrix combination to fail?

Excluding a broken environment risks on even breaking it in new ways and prevents testing changes that may fix it. The trick here is to run the job but to avoid considering its potential failure.

GitHub Staff
Message 5 of 6

Re: How to allow a special workflows actions matrix combination to fail?

Hey @ssbarnea ,

 

If you are trying to ensure that when that job fails, your other jobs do not cancel, you can use the fail-fast flag https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-...

 

 

GitHub Partner
Message 6 of 6

Re: How to allow a special workflows actions matrix combination to fail?

Hmm...You can split the combination (py38+osx) out of the current strategy and put it into a new job in the workflow file, use 'fast-fail' or 'jobs.<job_id>.steps.continue-on-error' as you wish.