Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/test-jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: test-jobs

# Runs the Data Manager Job Tester ("jote") against every job-based submodule.
#
# For each job repository we run 'jote --dry-run' (which does not execute any
# tests) against every manifest found in its 'data-manager' directory. A
# dry-run validates the Job Definition and Manifest files against the decoder
# schemas and lint rules without needing Docker or any running containers.
#
# jote is installed from PyPI (https://pypi.org/project/im-jote/) at the version
# pinned by the JOTE_VERSION variable below, so the check is reproducible; bump
# that single value to test against a newer tester and its schemas.

env:
# The version of the im-jote package (https://pypi.org/project/im-jote/) to
# install and run. Change this in one place to move every matrix leg.
JOTE_VERSION: '0.13.0'

on:
push:
branches:
- main
pull_request:
schedule:
# Weekly (Monday 06:24 UTC) so a new jote/schema release that changes
# validation is caught even without a repository change.
- cron: '24 6 * * 1'
workflow_dispatch:

jobs:
jote:
runs-on: ubuntu-latest
strategy:
# Test every repository even if one fails, so a single non-compliant
# repository does not hide the status of the others.
fail-fast: false
matrix:
repo:
- virtual-screening
- squonk2-cdk
- squonk2-chemaxon
- squonk2-fragmenstein
- squonk2-jaqpot
- squonk2-smartcyp
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Checkout the ${{ matrix.repo }} submodule
run: |
# The submodules are declared with SSH URLs; rewrite to anonymous
# HTTPS so the (public) job repository can be fetched without a key.
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init -- "${{ matrix.repo }}"

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'

- name: Install jote
run: |
python -m pip install --upgrade pip
pip install "im-jote==${JOTE_VERSION}"

- name: Dry-run jote against every manifest
working-directory: ${{ matrix.repo }}
run: |
shopt -s nullglob
manifests=(data-manager/manifest*.yaml data-manager/manifest*.yml)
if [ ${#manifests[@]} -eq 0 ]; then
echo "No manifests found in ${{ matrix.repo }}/data-manager"
exit 1
fi
rc=0
for manifest in "${manifests[@]}"; do
name="$(basename "${manifest}")"
echo "::group::jote --manifest ${name} --dry-run"
# --allow-no-tests keeps this a pure definition/schema check: a
# manifest whose jobs have no tests must not fail the dry-run.
jote --manifest "${name}" --dry-run --allow-no-tests || rc=1
echo "::endgroup::"
done
exit ${rc}
Loading