Skip to content

Reusable workflows live under .github #1

Reusable workflows live under .github

Reusable workflows live under .github #1

Workflow file for this run

---

Check failure on line 1 in .github/workflows/nextflow-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/nextflow-tests.yml

Invalid workflow file

`workflow-call` is not a valid event name
name: 'Nextflow tests'
on:
workflow-call:
# Inspired by https://blog.aspect.dev/github-actions-dynamic-matrix
jobs:
discover-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: listfiles
shell: python
run: |
import json
import os
from pathlib import Path
testfiles = [
str(item) for item in
Path(".").glob("**/configtest*.json")
]
with open(os.environ.get("GITHUB_OUTPUT"),
mode="w", encoding="utf-8") as outfile:
outfile.write(f"testfiles={json.dumps(testfiles)}\n")
outputs:
testfiles: ${{ steps.listfiles.outputs.testfiles }}
runtests:
runs-on: ubuntu-latest
needs: discover-tests
strategy:
matrix:
testfile: ${{ fromJSON(needs.discover-tests.outputs.testfiles) }}
steps:
- uses: actions/checkout@v4
- shell: python
with:
image: ghcr.io/uclahs-cds/nextflow-config-test:testing
run: |
import sys
from pathlib import Path
from configtest import NextflowConfigTest
clean = NextflowConfigTest.from_file(
"${{ matrix.testfile }}"
).check_results(Path(".").resolve())
if not clean:
sys.exit(1)