ci: cache evidence lane bootstrap and platformio core
This commit is contained in:
@@ -14,6 +14,9 @@ jobs:
|
||||
evidence_pack:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 25
|
||||
env:
|
||||
KILL_LIFE_PIO_MODE: native
|
||||
PLATFORMIO_CORE_DIR: ~/.platformio
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -22,12 +25,24 @@ jobs:
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
cache-dependency-path: |
|
||||
tools/compliance/requirements.txt
|
||||
tools/compliance/requirements-platformio.txt
|
||||
|
||||
- name: Cache PlatformIO core
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-platformio-${{ hashFiles('firmware/platformio.ini', 'tools/compliance/requirements-platformio.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-platformio-
|
||||
|
||||
- name: Bootstrap repo-local venv
|
||||
run: bash tools/bootstrap_python_env.sh --with-platformio
|
||||
|
||||
- name: Generate evidence pack summary
|
||||
run: KILL_LIFE_PIO_MODE=native ./.venv/bin/python tools/auto_check_ci_cd.py
|
||||
run: ./.venv/bin/python tools/auto_check_ci_cd.py
|
||||
|
||||
- name: Upload evidence pack artifact
|
||||
if: always()
|
||||
|
||||
@@ -55,6 +55,12 @@ Resultat:
|
||||
- `esp`: `rc=0`, evidence pack complet dans `docs/evidence/esp/`
|
||||
- `linux`: `rc=0`, evidence pack complet dans `docs/evidence/linux/`
|
||||
|
||||
Acceleration complementaire du 2026-03-13:
|
||||
|
||||
- `evidence_pack.yml` active des caches separes pour `pip` et `PlatformIO`.
|
||||
- La version de `PlatformIO` est figee dans `tools/compliance/requirements-platformio.txt`.
|
||||
- Le bootstrap Python et la CI evidence s'appuient maintenant sur la meme source de versionnement, ce qui reduit les retelechargements et rend la lane plus stable.
|
||||
|
||||
## Consequence operateur
|
||||
|
||||
- Un echec CI ne doit plus masquer l'evidence pack: les logs et resumes restent telechargeables via l'artifact `evidence-pack`.
|
||||
|
||||
@@ -66,7 +66,7 @@ sequenceDiagram
|
||||
| `tools/run_github_dispatch_mcp.sh` | launcher stdio du dispatch GitHub |
|
||||
| `.github/workflows/ci.yml` | gate principal `python-stable` sur la branche ou la PR |
|
||||
| `.github/workflows/repo_state.yml` | photographie exploitable du repo et artefacts de statut |
|
||||
| `.github/workflows/evidence_pack.yml` | bootstrap Python + `platformio` repo-local + evidence lane forcee en `native-pio` pour GitHub Actions |
|
||||
| `.github/workflows/evidence_pack.yml` | bootstrap Python + `platformio` repo-local + caches `pip`/`PlatformIO` + evidence lane forcee en `native-pio` |
|
||||
| `.github/workflows/release_signing.yml` | chemin de release signee par tag ou `workflow_dispatch` |
|
||||
| `docs/evidence/evidence_pack.md` | contrat minimal et chemins canoniques d'un evidence pack |
|
||||
| `docs/EVIDENCE_ALIGNMENT_2026-03-11.md` | note d'audit qui ferme l'ecart entre CI, preuves locales et doc |
|
||||
@@ -77,6 +77,7 @@ sequenceDiagram
|
||||
- Le retour utile n'est pas seulement `success/fail`, mais un ensemble de checks, artefacts et preuves consultables.
|
||||
- L'artifact `evidence-pack` est un dump de `docs/evidence/`; il reste utile meme si un target sort en `incomplete`.
|
||||
- La lane evidence GitHub n'a plus besoin du CAD stack Docker pour `PlatformIO`; elle force la voie `native-pio` depuis le venv repo-local.
|
||||
- Les caches `pip` et `PlatformIO` accelerent la lane sans changer le contrat des preuves produites.
|
||||
- `Kill_LIFE` garde la definition canonique des workflows et de leurs gates; le dispatch n'est qu'un mode d'execution distant.
|
||||
|
||||
## Next lots
|
||||
@@ -86,4 +87,5 @@ sequenceDiagram
|
||||
- `K-DA-005`: synchroniser la doc operateur avec les preuves et artefacts effectivement exposes.
|
||||
- `K-DA-006` est ferme par l'alignement du workflow `evidence_pack.yml` avec la chaine reelle `docs/evidence/*`.
|
||||
- `K-DA-007` est ferme par la voie `native-pio` repo-locale et le durcissement anti-artefacts obsoletes.
|
||||
- `K-DA-008`: accelerer la lane evidence GitHub avec cache `pip` / `PlatformIO`.
|
||||
- `K-DA-008` est ferme par l'ajout des caches `pip` / `PlatformIO` et du versionnement `requirements-platformio.txt`.
|
||||
- `K-DA-009`: exposer un resume evidence lisible dans le GitHub Step Summary.
|
||||
|
||||
@@ -68,6 +68,11 @@ Le script exécute :
|
||||
|
||||
La lane evidence CI force `KILL_LIFE_PIO_MODE=native` pour eviter de dependre du Docker CAD stack uniquement pour la collecte de preuves firmware.
|
||||
|
||||
Pour limiter le temps de bootstrap sur GitHub Actions, la lane evidence cache aussi :
|
||||
|
||||
- le cache `pip` resolu depuis `tools/compliance/requirements.txt` et `tools/compliance/requirements-platformio.txt`
|
||||
- le core `PlatformIO` dans `~/.platformio`
|
||||
|
||||
Le job peut échouer tout en laissant un evidence pack partiel exploitable. C’est un comportement voulu : les fichiers `*.result.json`, `*.stdout.txt`, `*.stderr.txt` et `summary.json` restent la première preuve de diagnostic. En revanche, `summary.json` ne peut plus sortir `ok` si la commande build/test la plus récente a renvoyé un code non nul.
|
||||
|
||||
## Checklist minimum PR
|
||||
|
||||
@@ -32,7 +32,8 @@ Rendre `Kill_LIFE` plus lisible comme socle canonique runtime/spec-first:
|
||||
- `K-DA-004` ferme par la synchronisation `docs/RUNBOOK.md`, `docs/index.md`, `docs/workflows/README.md`, `docs/AI_WORKFLOWS.md`, `docs/evidence/evidence_pack.md`
|
||||
- `K-DA-006` ferme par `.github/workflows/evidence_pack.yml`, `docs/evidence/evidence_pack.md` et `docs/EVIDENCE_ALIGNMENT_2026-03-11.md`
|
||||
- `K-DA-007` ferme par `tools/bootstrap_python_env.sh`, `tools/ci_runtime.py`, `tools/collect_evidence.py`, `.github/workflows/evidence_pack.yml` et `test/test_firmware_evidence.py`
|
||||
- `K-DA-008` ferme par `.github/workflows/evidence_pack.yml`, `tools/compliance/requirements-platformio.txt` et la mise en cache `pip` / `PlatformIO`
|
||||
|
||||
## Next tasks
|
||||
|
||||
- `K-DA-008` accelerer la lane evidence GitHub avec cache `pip` / `PlatformIO`
|
||||
- `K-DA-009` exposer un resume evidence lisible dans le GitHub Step Summary
|
||||
|
||||
@@ -7,6 +7,7 @@ PYTHON_BIN="${PYTHON_BIN:-python3}"
|
||||
REINSTALL=false
|
||||
WITH_PLATFORMIO=false
|
||||
REQ_FILE="${ROOT_DIR}/tools/compliance/requirements.txt"
|
||||
PIO_REQ_FILE="${ROOT_DIR}/tools/compliance/requirements-platformio.txt"
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
@@ -88,9 +89,9 @@ if ! "${VENV_DIR}/bin/python" -c "import yaml, jsonschema" >/dev/null 2>&1; then
|
||||
"${VENV_DIR}/bin/python" -m pip install 'jsonschema>=4.21.0'
|
||||
fi
|
||||
|
||||
if [[ "${WITH_PLATFORMIO}" == true ]] && [[ ! -x "${VENV_DIR}/bin/pio" ]]; then
|
||||
echo "[bootstrap-python] installing PlatformIO"
|
||||
"${VENV_DIR}/bin/python" -m pip install platformio
|
||||
if [[ "${WITH_PLATFORMIO}" == true ]]; then
|
||||
echo "[bootstrap-python] ensuring PlatformIO requirement"
|
||||
"${VENV_DIR}/bin/python" -m pip install -r "${PIO_REQ_FILE}"
|
||||
fi
|
||||
|
||||
echo "[bootstrap-python] python: ${VENV_DIR}/bin/python"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
platformio==6.1.19
|
||||
Reference in New Issue
Block a user