Skip to content

Update rnaseq.wdl

Update rnaseq.wdl #10

name: Auto-Build WDL Graphs
on:
push:
paths:
- "workflows/**/*.wdl"
pull_request:
paths:
- "workflows/**/*.wdl"
workflow_dispatch:
jobs:
build-graphs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Java (for womtool)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Install Graphviz
run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Download womtool
run: |
mkdir -p tools
curl -L -o tools/womtool.jar https://github.com/broadinstitute/cromwell/releases/download/90/womtool-90.jar
- name: Detect changed WDLs
id: changed
run: |
# Detect added or modified WDLs in workflows/
files=$(git diff --name-only HEAD~1 HEAD | grep '^workflows/.*\.wdl$' || true)
echo "changed_files=$files" >> $GITHUB_OUTPUT
echo "Changed WDL files:"
echo "$files"
- name: Build graphs for changed WDLs
if: steps.changed.outputs.changed_files != ''
run: |
echo "${{ steps.changed.outputs.changed_files }}" | while read -r wdl; do
[ -z "$wdl" ] && continue
dir=$(dirname "$wdl")
base=$(basename "$wdl" .wdl)
dot="${dir}/${base}.dot"
png="${dir}/${base}.png"
echo "Building graph for $wdl"
java -jar tools/womtool.jar graph "$wdl" > "$dot"
dot -Tpng "$dot" -o "$png"
done
- name: Commit and push graphs
if: steps.changed.outputs.changed_files != ''
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add workflows/**/*.dot workflows/**/*.png || true
git commit -m "Auto-update WDL workflow graphs" || echo "No changes to commit"
git push