Skip to content

Commit

Permalink
Merge branch 'main' into apitests-readme-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Dec 18, 2024
2 parents 1f7282b + 1e6926c commit 390bd66
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 25 deletions.
52 changes: 38 additions & 14 deletions .github/workflows/cromwell-test-run.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,56 @@
name: Cromwell Test Run

on:
pull_request:
workflow_dispatch:

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Find WDL Directories
id: set-matrix
run: |
# Find all directories containing .wdl files
dirs=$(find . -type f -name "*.wdl" -exec dirname {} \; | sort -u | sed 's|^\./||' | jq -R . | jq -s | jq -c .)
echo "Directories: $dirs"
echo "matrix=$dirs" >> $GITHUB_OUTPUT
testrun:
needs: generate-matrix
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
wdl: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Set Up Java

- name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
-
name: Pull Cromwell Jarfile
run: wget -q https://github.com/broadinstitute/cromwell/releases/download/86/cromwell-86.jar
-
name: Execute Test Run of WDL Workflows
run: |
java -jar cromwell-86.jar run helloHostname/helloHostname.wdl
java -jar cromwell-86.jar run helloModuleHostname/helloModuleHostname.wdl
java -jar cromwell-86.jar run helloDockerHostname/helloDockerHostname.wdl

- name: Pull Cromwell Jarfile
run: wget -q https://github.com/broadinstitute/cromwell/releases/download/86/cromwell-86.jar

- name: Execute Test Run of WDL Workflows
run: |
cmd="java -jar cromwell-86.jar run ${{ matrix.wdl }}/${{ matrix.wdl }}.wdl"
if [[ -f "${{ matrix.wdl }}/inputs.json" ]]; then
cmd="$cmd -i ${{ matrix.wdl }}/inputs.json"
fi
if [[ -f "${{ matrix.wdl }}/options.json" ]]; then
cmd="$cmd -o ${{ matrix.wdl }}/options.json"
fi
echo "Running command: $cmd"
eval "$cmd"
43 changes: 32 additions & 11 deletions .github/workflows/womtools-validate.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
name: WOMtool Validation of WDL Script

on:
pull_request:
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Find WDL Directories
id: set-matrix
run: |
# Find all directories containing .wdl files
dirs=$(find . -type f -name "*.wdl" -exec dirname {} \; | sort -u | sed 's|^\./||' | jq -R . | jq -s | jq -c .)
echo "Directories: $dirs"
echo "matrix=$dirs" >> $GITHUB_OUTPUT
womtoolval:
needs: generate-matrix
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
strategy:
matrix:
wdl: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4

-
name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

-
name: Pull WOMtool Jarfile
run: wget -q https://github.com/broadinstitute/cromwell/releases/download/86/womtool-86.jar
-

-
name: Validate WDL Scripts
run: |
java -jar womtool-86.jar validate helloHostname/helloHostname.wdl
java -jar womtool-86.jar validate helloModuleHostname/helloModuleHostname.wdl
java -jar womtool-86.jar validate helloDockerHostname/helloDockerHostname.wdl
cmd="java -jar womtool-86.jar validate ${{ matrix.wdl }}/${{ matrix.wdl }}.wdl"
if [[ -f "${{ matrix.wdl }}/inputs.json" ]]; then
cmd="$cmd -i ${{ matrix.wdl }}/inputs.json"
fi
echo "Running command: $cmd"
eval "$cmd"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# wdl-unit-tests

![Runs on Cromwell](https://github.com/FredHutch/wdl-unit-tests/actions/workflows/cromwell-test-run.yml/badge.svg)
![WOMtool Validation](https://github.com/FredHutch/wdl-unit-tests/actions/workflows/womtools-validate.yml/badge.svg)

A collection of minimal WDL (Workflow Description Language) workflows designed for testing WDL execution environments and backend configurations. Each workflow tests a specific aspect of WDL functionality while maintaining simplicity for easy debugging and verification.

## Workflows
Expand Down
5 changes: 5 additions & 0 deletions helloDockerHostname/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workflow_failure_mode": "ContinueWhilePossible",
"write_to_cache": false,
"read_from_cache": false
}
5 changes: 5 additions & 0 deletions helloHostname/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workflow_failure_mode": "ContinueWhilePossible",
"write_to_cache": false,
"read_from_cache": false
}
5 changes: 5 additions & 0 deletions helloModuleHostname/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workflow_failure_mode": "ContinueWhilePossible",
"write_to_cache": false,
"read_from_cache": false
}

0 comments on commit 390bd66

Please sign in to comment.