Add /docs/ directory with user and technical documentation extracted from README, AGENTS.md, and source code. Add scripts/sync_wiki.py to sync docs to Gitea wiki via API. Add scripts/doc_coverage.py to check CLI commands, modules, and CI scripts are documented. Add sync-wiki.yml workflow for auto-sync on merge and release. Slim down README.md to lean entry point. 28 new unit tests, 100% coverage maintained. Closes GRM-36
95 lines
2.9 KiB
YAML
95 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
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
|
|
- name: Release dry-run validation
|
|
run: |
|
|
. .venv/bin/activate
|
|
PYTHONPATH=src python3 scripts/release.py --dry-run || true
|
|
- name: Documentation coverage check
|
|
run: |
|
|
. .venv/bin/activate
|
|
PYTHONPATH=src python3 scripts/doc_coverage.py
|
|
|
|
detect-changes:
|
|
runs-on: docker
|
|
outputs:
|
|
ansible-changed: ${{ steps.detect.outputs.ansible-changed }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Detect changed paths
|
|
id: detect
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
BASE="origin/master"
|
|
HEAD="${{ github.event.pull_request.head.sha }}"
|
|
else
|
|
BASE="HEAD~1"
|
|
HEAD="HEAD"
|
|
fi
|
|
# Check if any Ansible-related files changed
|
|
ANSIBLE_CHANGED=$(git diff --name-only "$BASE" "$HEAD" -- ansible/ .ansible-lint 2>/dev/null | head -1)
|
|
if [ -n "$ANSIBLE_CHANGED" ]; then
|
|
echo "ansible-changed=true" >> "$GITHUB_OUTPUT"
|
|
echo "Ansible files changed — molecule tests will run."
|
|
else
|
|
echo "ansible-changed=false" >> "$GITHUB_OUTPUT"
|
|
echo "No Ansible files changed — skipping molecule tests."
|
|
fi
|
|
|
|
molecule-tests:
|
|
needs: [quality, detect-changes]
|
|
if: needs.detect-changes.outputs.ansible-changed == 'true'
|
|
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 }}
|