Skip to content

Commit 1569e57

Browse files
fix(ci): make child branch checks robust
Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
1 parent 4aceb4a commit 1569e57

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: Check for changes
2929
runs-on: ubuntu-latest
3030
outputs:
31-
nf_test_files: ${{ steps.list.outputs.components }}
31+
nf_test_files: ${{ steps.collect.outputs.nf_test_files }}
3232
steps:
3333
- uses: actions/checkout@v3
3434
with:
@@ -37,14 +37,32 @@ jobs:
3737
- name: List nf-test files
3838
id: list
3939
uses: adamrtalbot/detect-nf-test-changes@v0.0.3
40+
continue-on-error: true
4041
with:
4142
head: ${{ github.sha }}
4243
base: origin/${{ github.base_ref }}
4344
include: .github/include.yaml
4445

46+
- name: Collect nf-test files
47+
id: collect
48+
shell: bash
49+
run: |
50+
components='${{ steps.list.outputs.components }}'
51+
if [[ '${{ steps.list.outcome }}' == 'success' && -n "$components" && "$components" != '[]' ]]; then
52+
echo "nf_test_files=$components" >> "$GITHUB_OUTPUT"
53+
exit 0
54+
fi
55+
56+
python - <<'PY' >> "$GITHUB_OUTPUT"
57+
import glob
58+
import json
59+
files = sorted(glob.glob("tests/**/main.nf.test", recursive=True))
60+
print(f"nf_test_files={json.dumps(files)}")
61+
PY
62+
4563
- name: print list of nf-test files
4664
run: |
47-
echo ${{ steps.list.outputs.components }}
65+
echo '${{ steps.collect.outputs.nf_test_files }}'
4866
4967
test:
5068
name: ${{ matrix.nf_test_files }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }}

.github/workflows/linting.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ jobs:
5050
- name: Install dependencies
5151
run: |
5252
python -m pip install --upgrade pip
53-
pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}
53+
if [ -n "${{ steps.read_yml.outputs['nf_core_version'] }}" ]; then
54+
pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}
55+
else
56+
pip install nf-core
57+
fi
5458
5559
- name: Run nf-core pipelines lint
5660
if: ${{ github.base_ref != 'master' }}

0 commit comments

Comments
 (0)