|
| 1 | +name: ModelDB CI (reuse wheels) |
| 2 | + |
| 3 | +# Retest ModelDB against an existing multi-wheel artifact from a prior NEURON |
| 4 | +# Release (or other) run — without rebuilding wheels. |
| 5 | +# |
| 6 | +# Operator flow: |
| 7 | +# 1. Open a Release (or other) run that already uploaded artifact "wheels". |
| 8 | +# 2. Copy the wheels artifact id (or a github.com .../artifacts/<id> URL). |
| 9 | +# 3. Actions → ModelDB CI (reuse wheels) → Run workflow: |
| 10 | +# wheels_artifact = that id or URL |
| 11 | +# neuron_v1 = baseline, e.g. neuron==9.0.1 |
| 12 | +# modeldb_ci_ref = master, or a nrn-modeldb-ci branch (e.g. a fix PR) |
| 13 | +# models_to_run = optional subset; empty = all ModelDB NEURON models |
| 14 | +# |
| 15 | +# Note: ModelDB installs one compatible wheel from the zip (first that pip |
| 16 | +# accepts on ubuntu-latest / configured Python), not the full OS×Python matrix. |
| 17 | + |
| 18 | +on: |
| 19 | + workflow_dispatch: |
| 20 | + inputs: |
| 21 | + wheels_artifact: |
| 22 | + description: 'GHA wheels artifact id, or URL ending in that id (from a prior run)' |
| 23 | + required: true |
| 24 | + type: string |
| 25 | + neuron_v1: |
| 26 | + description: 'Baseline NEURON (PyPI), e.g. neuron==9.0.1 or neuron' |
| 27 | + required: true |
| 28 | + default: 'neuron' |
| 29 | + type: string |
| 30 | + modeldb_ci_ref: |
| 31 | + description: 'nrn-modeldb-ci git ref (branch/tag/SHA) to checkout for the package' |
| 32 | + required: false |
| 33 | + default: 'master' |
| 34 | + type: string |
| 35 | + models_to_run: |
| 36 | + description: 'Empty for all models; or space-separated ModelDB accession numbers' |
| 37 | + required: false |
| 38 | + default: '' |
| 39 | + type: string |
| 40 | + |
| 41 | +jobs: |
| 42 | + # Normalize bare artifact ids to a URL shape that nrn-modeldb-ci understands |
| 43 | + # (starts with https://github.com/neuronsimulator/ and ends with the id). |
| 44 | + normalize: |
| 45 | + name: Normalize wheels artifact reference |
| 46 | + runs-on: ubuntu-latest |
| 47 | + outputs: |
| 48 | + neuron_v2: ${{ steps.norm.outputs.neuron_v2 }} |
| 49 | + modeldb_ci_ref: ${{ steps.norm.outputs.modeldb_ci_ref }} |
| 50 | + steps: |
| 51 | + - name: Build neuron_v2 string for modeldb-ci |
| 52 | + id: norm |
| 53 | + env: |
| 54 | + RAW: ${{ inputs.wheels_artifact }} |
| 55 | + REF: ${{ inputs.modeldb_ci_ref }} |
| 56 | + run: | |
| 57 | + set -euo pipefail |
| 58 | + raw="$(echo "${RAW}" | tr -d '[:space:]')" |
| 59 | + if [[ -z "${raw}" ]]; then |
| 60 | + echo "wheels_artifact is empty" >&2 |
| 61 | + exit 1 |
| 62 | + fi |
| 63 | + if [[ "${raw}" =~ ^[0-9]+$ ]]; then |
| 64 | + v2="https://github.com/neuronsimulator/nrn/actions/artifacts/${raw}" |
| 65 | + elif [[ "${raw}" =~ ^https://github.com/neuronsimulator/ ]]; then |
| 66 | + v2="${raw}" |
| 67 | + else |
| 68 | + # Allow other strings that still end with an artifact id |
| 69 | + if [[ "${raw}" =~ ([0-9]+)$ ]]; then |
| 70 | + v2="https://github.com/neuronsimulator/nrn/actions/artifacts/${BASH_REMATCH[1]}" |
| 71 | + else |
| 72 | + echo "Cannot parse wheels_artifact: ${raw}" >&2 |
| 73 | + exit 1 |
| 74 | + fi |
| 75 | + fi |
| 76 | + ref="${REF:-master}" |
| 77 | + echo "neuron_v2=${v2}" |
| 78 | + echo "modeldb_ci_ref=${ref}" |
| 79 | + echo "neuron_v2=${v2}" >> "${GITHUB_OUTPUT}" |
| 80 | + echo "modeldb_ci_ref=${ref}" >> "${GITHUB_OUTPUT}" |
| 81 | +
|
| 82 | + nrn-modeldb-ci: |
| 83 | + name: Run modelDB CI (reuse wheels) |
| 84 | + needs: |
| 85 | + - normalize |
| 86 | + # Use @master once hines-grok/modeldb-ci-ref-input (ref input) is merged. |
| 87 | + # Until then, the callable workflow with `ref` lives on that branch. |
| 88 | + uses: neuronsimulator/nrn-modeldb-ci/.github/workflows/nrn-modeldb-ci.yaml@hines-grok/modeldb-ci-ref-input |
| 89 | + with: |
| 90 | + neuron_v1: ${{ inputs.neuron_v1 }} |
| 91 | + neuron_v2: ${{ needs.normalize.outputs.neuron_v2 }} |
| 92 | + ref: ${{ needs.normalize.outputs.modeldb_ci_ref }} |
| 93 | + models_to_run: ${{ inputs.models_to_run }} |
| 94 | + repo: neuronsimulator/nrn-modeldb-ci |
0 commit comments