forked from nf-core/longraredisease
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
54 lines (42 loc) · 1.54 KB
/
action.yml
File metadata and controls
54 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Find tests
description: Finds all subdirectories and local modules containing a 'tests' folder, outputs the directory as tag. In addition, find all pipeline-level tests that are directly under the 'tests' directory. This assumes that the pipeline-level tests has a tag named the same as the file.
inputs: {}
outputs:
tags:
description: JSON array of matching subworkflow directory names
value: ${{ steps.search.outputs.tags }}
runs:
using: "composite"
steps:
- shell: bash
id: "search"
run: |
names_json="["
first=true
# Find all 'tests' dirs anywhere under modules/local and subworkflows
tests_dirs=$(find modules/local subworkflows -type d -name tests)
for td in $tests_dirs; do
module_dir=$(dirname "$td")
module_name=$(basename "$module_dir")
if [ "$first" = true ]; then
first=false
else
names_json+=","
fi
names_json+="\"$module_name\""
done
# Find all *.test files directly under ./tests (top-level)
test_files=$(find tests -maxdepth 1 -type f -name '*.test')
for tf in $test_files; do
tf_base=$(basename "$tf" .nf.test)
echo "Found top-level test file: $tf_base"
if [ "$first" = true ]; then
first=false
else
names_json+=","
fi
names_json+="\"$tf_base\""
done
names_json+="]"
# Write to GitHub Actions outputs
echo "tags=$names_json" >> $GITHUB_OUTPUT