Skip to content

Commit b610125

Browse files
adthrashera-frantz
andauthored
Wdl workflow (#23)
* Initial implementation of XenoCP workflow in WDL * Implementing multiple mappers * Initial implementation of XenoCP workflow in WDL * Implementing multiple mappers * Add explicit queryname sort step * Update GitHub links * Update wdl/tools/xenocp.wdl Co-authored-by: Andrew Frantz <andrew.frantz@stjude.org> * Implement @a-frantz suggestions * Implement @a-frantz suggestions * Add lint and miniwdl checks for WDL * fix: typo * remove unused CPU argument * Swap Docker version to 3.1.0 in anticipation of new release * Connect unused inputs and remove remaining unused options Co-authored-by: Andrew Frantz <andrew.frantz@stjude.org>
1 parent 95994a1 commit b610125

File tree

4 files changed

+616
-0
lines changed

4 files changed

+616
-0
lines changed

.github/workflows/lint-check.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: lint-check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
import_syntax_check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Check import syntax
17+
run: |
18+
EXITCODE=0
19+
for file in $(find . -name '*.wdl'); do
20+
>&2 echo "Checking file $file..."
21+
import_lines=$(awk '/import/' "$file")
22+
bad_lines=$(echo "$import_lines" | awk '!/https:\/\/raw.githubusercontent.com\/stjude\/xenocp\/master/ && !/https:\/\/raw.githubusercontent.com\/stjudecloud\/workflows\/master/' | grep -v '# lint-check: ignore') || true
23+
if [ -n "$bad_lines" ]; then
24+
>&2 echo "Must import files from the master branch on Github."
25+
>&2 echo "The following lines are bad:"
26+
>&2 echo "$bad_lines"
27+
>&2 echo ""
28+
EXITCODE=1
29+
fi
30+
done
31+
exit $EXITCODE
32+
docker_pull_check:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Ensure SemVer'd docker images are being pulled
37+
run: |
38+
EXITCODE=0
39+
files=$(find . -name '*.wdl')
40+
for file in $files; do
41+
while IFS= read -r line; do
42+
tag=$(echo "$line" | awk -F ':' '{print substr($3, 1, length($3)-1)}')
43+
if ! [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$ ]]; then
44+
>&2 echo "All Docker containers must be using an official SemVer tagged image"
45+
>&2 echo "Offending line: $line"
46+
>&2 echo "In file: $file"
47+
EXITCODE=1
48+
fi
49+
done < <(awk '/docker: .*stjudecloud/ || /docker: .*stjude/' < "$file")
50+
done
51+
exit $EXITCODE

.github/workflows/miniwdl-check.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: miniwdl-check
2+
3+
on: [push]
4+
5+
jobs:
6+
miniwdl_check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python
11+
uses: actions/setup-python@v1
12+
with:
13+
python-version: '3.6'
14+
- name: Install miniwdl
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install miniwdl
18+
- name: Run miniwdl
19+
run: |
20+
EXITCODE=0
21+
echo "Checking WDL files using \`miniwdl check\`."
22+
files=$(find . -name '*.wdl')
23+
for file in $files; do
24+
sed -i 's,https://raw.githubusercontent.com/stjude/xenocp/'"$(echo ${GITHUB_REF#refs/heads/})"','"$(pwd)"',g' "$file"
25+
sed -i 's,https://raw.githubusercontent.com/stjude/xenocp/master,'"$(pwd)"',g' "$file"
26+
done
27+
for file in $files; do
28+
echo " [***] $file [***]"
29+
miniwdl check "$file"
30+
EXITCODE=$(($? || EXITCODE))
31+
done
32+
exit $EXITCODE

0 commit comments

Comments
 (0)