FEAT: Refactor CI to only test modified files - #1123
Conversation
jfy133
left a comment
There was a problem hiding this comment.
I think this needs somone else to look a bit more thoroughly too, but I guess I can follow the bash bits - but not the python stuff.
Don't forget to update docs on this Repo but also on the website docs to remove the requirement to modify the action file when merged!
| fi | ||
|
|
||
| # Core infrastructure files that should trigger a full test | ||
| if echo "$CHANGED" | grep -qE '^(\.github/workflows/main\.yml|nextflow\.config|nfcore_custom\.config|configtest\.nf|bin/|pipeline/[^/]+\.config)$'; then |
There was a problem hiding this comment.
Bit ugly to hard code this into the code, is there not a way we can have a separate file that gets loaded here?
| fi | ||
|
|
||
| # If only docs/README/etc changed, skip tests | ||
| if ! echo "$CHANGED" | grep -qvE '^(docs/|README\.md|CITATION\.cff|LICENSE|\.editorconfig|\.gitattributes|\.pre-commit-config\.yaml|\.prettierrc\.yml|\.prettierignore|\.github/(PULL_REQUEST_TEMPLATE\.md|CODEOWNERS|generate_codeowners\.sh))$'; then |
| fetch-depth: 0 | ||
| - id: detect | ||
| run: | | ||
| set -euo pipefail |
There was a problem hiding this comment.
This is a very very long bit of bash to be in the action itself could this not be moved into a standalone action thingy or a little script?
| ### Check Github Config now | ||
| tests = set() | ||
| ### Ignore these profiles | ||
| ignore_me = ["czbiohub_aws"] |
There was a problem hiding this comment.
Is this why it's now failing and not before? Why was this being ignored in teh first place?
yeah, sorry, this is still a draft. |
Description
Replace the hardcoded 154-profile test matrix with a dynamic
detect-changesjob that only tests profiles affected by the PR.Inspired by nf-core/modules' approach with
detect-nf-test-changes.Changes
.github/workflows/main.ymldetect-changesjob: Usesgit diffwithfetch-depth: 0between base and head to determine which files changed, then builds a JSON test matrix dynamicallyprofile_testmatrix: Instead of a hardcoded list of 154 profiles, the matrix is built fromfromJson(needs.detect-changes.outputs.tests)conf/<name>.configchanges → test only that profileconf/sanger/farm22.configorconf/uppmax/rackham.configchanges → test the parent profileconf/pipeline/<pipeline>/<name>.configchanges → test the matching pipeline profiles with-c pipeline/<pipeline>.config --custom_config_base ${GITHUB_WORKSPACE}type: pipelinetest steps that runnextflow run configtest.nf -profile <name> -c pipeline/<pipeline>.config --custom_config_base ${GITHUB_WORKSPACE}bin/cchecker.pynfcore_custom.confighave config files inconf/conf/are registered innfcore_custom.configpipeline/<pipeline>.configTesting
This PR should be tested by creating a PR that modifies a single config file and verifying only that profile's test runs.