Gitea Actions does not implement fail-fast/max-parallel for matrix jobs, so a failing runner does not stop the others. Added molecule_ci_guard.py which polls the Gitea API in a background thread. If any other molecule runner reports failure, the current runner kills its molecule subprocess and exits early. CI returns to a 3-runner matrix; each runner executes its assigned pairs in parallel via run_molecule_parallel.py, guarded by molecule_ci_guard.py. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [master]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
quality:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up environment
|
|
run: make setup
|
|
- name: Lint all
|
|
run: |
|
|
. .venv/bin/activate
|
|
make lint-all
|
|
- name: Unit tests with 100% coverage
|
|
run: |
|
|
. .venv/bin/activate
|
|
make pytest-cov
|
|
- name: Check unit test speed
|
|
run: |
|
|
. .venv/bin/activate
|
|
python3 scripts/check_test_speed.py --max-seconds 10
|
|
|
|
molecule-tests:
|
|
needs: quality
|
|
runs-on: docker
|
|
strategy:
|
|
matrix:
|
|
runner-index: [0, 1, 2]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up environment
|
|
run: make setup
|
|
- name: Discover assigned test pairs
|
|
run: |
|
|
. .venv/bin/activate
|
|
PAIRS=$(python3 scripts/distribute_molecule.py --runner-index ${{ matrix.runner-index }} --max-runners 3)
|
|
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
|
|
env:
|
|
GITEA_URL: ${{ github.server_url }}
|
|
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
RUN_ID: ${{ github.run_id }}
|
|
JOB_NAME: ${{ github.job }}
|
|
MATRIX_INDEX: ${{ matrix.runner-index }}
|
|
GITEA_REPOSITORY: ${{ github.repository }}
|