A limitation of GitHub actions is that ci jobs that used as checks required to allow a PR to merge, are always required, even if they were skipped.
In the case they were skipped...well the ci check isn't passed, not allowing a valid PR to merge.
A workaround is to use ${{ !(failure() || cancelled()) }} as a condition, meaning: if the dependents jobs didn't fail or weren't cancelled, execute (especially: if dependents jobs were skipped, execute).
This can be used as an if condition in a dummy job that will always be executed and successful, unless the dependents jobs failed or were cancelled. Which is what we want.
This PR does not affect any sol files, so the _tests and _slither matrix jobs are all skipped.
However tests and slither which depends on _tests and _slither respectively and are used as ci required checks, are still executed and pass, allowing the PR to merge.
This will speed up even more the CI, and avoid ci checks being a stuck with waiting for status to be reported state.
Fix #22
A limitation of GitHub actions is that ci jobs that used as checks required to allow a PR to merge, are always required, even if they were skipped.
In the case they were skipped...well the ci check isn't passed, not allowing a valid PR to merge.
A workaround is to use
${{ !(failure() || cancelled()) }}
as a condition, meaning: if the dependents jobs didn't fail or weren't cancelled, execute (especially: if dependents jobs were skipped, execute).This can be used as an
if
condition in a dummy job that will always be executed and successful, unless the dependents jobs failed or were cancelled. Which is what we want.The workflow diagram illustrates well what is going on:
This PR does not affect any
sol
files, so the_tests
and_slither
matrix jobs are all skipped. Howevertests
andslither
which depends on_tests
and_slither
respectively and are used as ci required checks, are still executed and pass, allowing the PR to merge.This will speed up even more the CI, and avoid ci checks being a stuck with
waiting for status to be reported
state.