Is your feature request related to a problem? Please describe.
An attempt was made to avoid running tests when only documentation was changed by adding patterns to paths-ignore in the actions files. This has the effect of making checks not run which blocks PRs, the hope was instead that these would show up as successfully ignored but it's not to be.
The alternative is to conditions the steps of jobs within actions on a check against changes. My idea is to use checking code in one job to detect if there's code change in Python files or changes in any other non-documentation file, then condition steps on that result. This would cause documentation only changes to not trigger tests, so changes to documentation files are ignored, and Python changes affecting only docstrings or comments are ignored.
Describe the solution you'd like
A prototype solution is here: https://github.com/ericspod/ActionsTest/blob/768a042fe2ae0693b528486be438b74081d77406/.github/workflows/test.yml
This uses a Python script to parse source files and compare them at the AST level, while also ignoring documentation files. Any other file changes trigger tests just in case. This uses the standard library so no dependencies exist other than Python.
The first job uses this script inside a bash loop going through every changed file. The output is then used by subsequent jobs to skip the test steps if no changes are found, so the job runs successfully even if nothing is done.
Describe alternatives you've considered
Using paths-ignore won't work in conjunction with require job passes for PRs to be mergeable. There isn't another actions mechanism to do this it seems.
Is your feature request related to a problem? Please describe.
An attempt was made to avoid running tests when only documentation was changed by adding patterns to
paths-ignorein the actions files. This has the effect of making checks not run which blocks PRs, the hope was instead that these would show up as successfully ignored but it's not to be.The alternative is to conditions the steps of jobs within actions on a check against changes. My idea is to use checking code in one job to detect if there's code change in Python files or changes in any other non-documentation file, then condition steps on that result. This would cause documentation only changes to not trigger tests, so changes to documentation files are ignored, and Python changes affecting only docstrings or comments are ignored.
Describe the solution you'd like
A prototype solution is here: https://github.com/ericspod/ActionsTest/blob/768a042fe2ae0693b528486be438b74081d77406/.github/workflows/test.yml
This uses a Python script to parse source files and compare them at the AST level, while also ignoring documentation files. Any other file changes trigger tests just in case. This uses the standard library so no dependencies exist other than Python.
The first job uses this script inside a bash loop going through every changed file. The output is then used by subsequent jobs to skip the test steps if no changes are found, so the job runs successfully even if nothing is done.
Describe alternatives you've considered
Using
paths-ignorewon't work in conjunction with require job passes for PRs to be mergeable. There isn't another actions mechanism to do this it seems.