fix: molecule-tests static matrix and role_dir path fix
This commit is contained in:
+19
-3
@@ -133,24 +133,40 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
runner-index: ${{ fromJSON(needs.discover-runners.outputs.runner-indices) }}
|
||||
runner-index: [1, 2, 3]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
run: make setup
|
||||
- name: Discover assigned test pairs
|
||||
env:
|
||||
RUNNER_INDEX: ${{ matrix.runner-index }}
|
||||
MAX_RUNNERS: ${{ needs.discover-runners.outputs.runner-count }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
. .venv/bin/activate
|
||||
RUNNER_INDEX="${{ matrix.runner-index }}"
|
||||
MAX_RUNNERS="${{ needs.discover-runners.outputs.runner-count }}"
|
||||
echo "Runner index: $RUNNER_INDEX"
|
||||
echo "Max runners: $MAX_RUNNERS"
|
||||
# Skip if runner index exceeds available runners
|
||||
if [ "$RUNNER_INDEX" -gt "$MAX_RUNNERS" ]; then
|
||||
echo "Skipping — runner index $RUNNER_INDEX > max runners $MAX_RUNNERS"
|
||||
echo "TEST_PAIRS=" >> $GITHUB_ENV
|
||||
echo "SKIP=true" >> $GITHUB_ENV
|
||||
exit 0
|
||||
fi
|
||||
PAIRS=$(python3 scripts/ci/distribute_molecule.py --runner-index "$RUNNER_INDEX" --max-runners "$MAX_RUNNERS")
|
||||
echo "Assigned pairs: $PAIRS"
|
||||
echo "TEST_PAIRS=$PAIRS" >> $GITHUB_ENV
|
||||
echo "SKIP=false" >> $GITHUB_ENV
|
||||
- name: Run molecule tests
|
||||
if: env.SKIP != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
. .venv/bin/activate
|
||||
if [ -z "$TEST_PAIRS" ]; then
|
||||
echo "No test pairs assigned — skipping"
|
||||
exit 0
|
||||
fi
|
||||
python3 scripts/ci/molecule_ci_guard.py $TEST_PAIRS
|
||||
env:
|
||||
GITEA_URL: ${{ github.server_url }}
|
||||
|
||||
Reference in New Issue
Block a user