GRM-37: refactor: Split CI scripts, fix release PYTHONPATH, dynamic runner discovery

This commit is contained in:
2026-06-21 20:44:39 +00:00
parent 56eb241b77
commit 5511cba1b0
38 changed files with 908 additions and 422 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
PYTHONPATH: src
run: |
python3 scripts/auto_merge.py \
python3 scripts/ci/auto_merge.py \
"${{ github.head_ref }}" \
"${{ github.event.pull_request.title }}" \
"${{ github.repository }}" \
+33 -6
View File
@@ -29,7 +29,7 @@ jobs:
- name: Documentation coverage check
run: |
. .venv/bin/activate
PYTHONPATH=src python3 scripts/doc_coverage.py
PYTHONPATH=src python3 scripts/ci/doc_coverage.py
release-dry-run:
needs: [quality, detect-changes]
@@ -54,7 +54,7 @@ jobs:
- name: Release dry-run validation
run: |
. .venv/bin/activate
PYTHONPATH=src python3 scripts/release.py --dry-run || true
PYTHONPATH=src python3 scripts/ci/release.py --dry-run || true
detect-changes:
runs-on: docker
@@ -94,13 +94,40 @@ jobs:
echo "No user-facing files changed — skipping release dry-run."
fi
discover-runners:
needs: [detect-changes]
if: needs.detect-changes.outputs.ansible-changed == 'true'
runs-on: docker
outputs:
runner-count: ${{ steps.discover.outputs.runner-count }}
runner-indices: ${{ steps.discover.outputs.runner-indices }}
steps:
- uses: actions/checkout@v4
- name: Set up environment
run: make setup
- name: Discover available runners
id: discover
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
MOLECULE_RUNNERS: ${{ vars.MOLECULE_RUNNERS }}
PYTHONPATH: src
run: |
. .venv/bin/activate
OUTPUT=$(python3 scripts/ci/discover_runners.py --owner "${{ github.repository_owner }}" --repo "${{ github.event.repository.name }}")
echo "$OUTPUT"
# Parse outputs
RUNNER_COUNT=$(echo "$OUTPUT" | grep '^count=' | cut -d= -f2)
RUNNER_INDICES=$(echo "$OUTPUT" | grep '^indices=' | cut -d= -f2)
echo "runner-count=$RUNNER_COUNT" >> "$GITHUB_OUTPUT"
echo "runner-indices=$RUNNER_INDICES" >> "$GITHUB_OUTPUT"
molecule-tests:
needs: [quality, detect-changes]
needs: [quality, detect-changes, discover-runners]
if: needs.detect-changes.outputs.ansible-changed == 'true'
runs-on: docker
strategy:
matrix:
runner-index: [0, 1, 2]
runner-index: ${{ fromJSON(needs.discover-runners.outputs.runner-indices) }}
steps:
- uses: actions/checkout@v4
- name: Set up environment
@@ -108,14 +135,14 @@ jobs:
- name: Discover assigned test pairs
run: |
. .venv/bin/activate
PAIRS=$(python3 scripts/distribute_molecule.py --runner-index ${{ matrix.runner-index }} --max-runners 3)
PAIRS=$(python3 scripts/ci/distribute_molecule.py --runner-index ${{ matrix.runner-index }} --max-runners ${{ needs.discover-runners.outputs.runner-count }})
echo "Assigned pairs: $PAIRS"
echo "TEST_PAIRS=$PAIRS" >> $GITHUB_ENV
- name: Run molecule tests
run: |
set -euo pipefail
. .venv/bin/activate
python3 scripts/molecule_ci_guard.py $TEST_PAIRS
python3 scripts/ci/molecule_ci_guard.py $TEST_PAIRS
env:
GITEA_URL: ${{ github.server_url }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
+1 -1
View File
@@ -18,6 +18,6 @@ jobs:
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
PYTHONPATH: src
run: |
python3 scripts/post_merge.py \
python3 scripts/ci/post_merge.py \
"$(git log -1 --pretty=%B)" \
--commit-sha "$(git rev-parse HEAD)"
+2 -2
View File
@@ -37,7 +37,7 @@ jobs:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYTHONPATH: src
run: |
python3 scripts/publish.py \
python3 scripts/ci/publish.py \
"${{ github.ref_name }}" \
"${{ github.repository }}"
- name: Notify on failure
@@ -46,7 +46,7 @@ jobs:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: src
run: |
python3 scripts/notify_failure.py \
python3 scripts/ci/notify_failure.py \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "publish" \
+2 -2
View File
@@ -34,7 +34,7 @@ jobs:
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/release.py
python3 scripts/ci/release.py
- name: Notify on failure
if: failure()
env:
@@ -42,7 +42,7 @@ jobs:
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/notify_failure.py \
python3 scripts/ci/notify_failure.py \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "release" \
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/sync_wiki.py --repo "${{ github.repository }}"
python3 scripts/ci/sync_wiki.py --repo "${{ github.repository }}"
- name: Tag wiki on release
if: startsWith(github.ref, 'refs/tags/v')
env: