diff --git a/.gitea/workflows/canaries.yml b/.gitea/workflows/canaries.yml index bf568b5..9d064d3 100644 --- a/.gitea/workflows/canaries.yml +++ b/.gitea/workflows/canaries.yml @@ -22,10 +22,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - + # No actions/setup-python: canaries are stdlib unittest on the image's + # system Python 3.12 (older act_runner mishandles setup-python's PATH). - name: Run canaries run: python3 -m unittest discover -t . -s tests/canaries -v diff --git a/.gitea/workflows/prd-number.yml b/.gitea/workflows/prd-number.yml index 3377ac4..0784b1d 100644 --- a/.gitea/workflows/prd-number.yml +++ b/.gitea/workflows/prd-number.yml @@ -37,11 +37,8 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - + # No actions/setup-python: the inline script is stdlib-only on the + # image's system Python 3.12 (older act_runner mishandles its PATH). - name: Configure git run: | git config user.name "github-actions[bot]" diff --git a/.gitea/workflows/update-badges.yml b/.gitea/workflows/update-badges.yml index 2c587f4..c802072 100644 --- a/.gitea/workflows/update-badges.yml +++ b/.gitea/workflows/update-badges.yml @@ -20,21 +20,18 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - + # No actions/setup-python: the runner image ships Python 3.12 and older + # act_runner engines mishandle setup-python's PATH. Install into the + # ephemeral job container's system Python (--break-system-packages is + # safe because the container is disposable). - name: Install dev dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt + run: python3 -m pip install --break-system-packages -r requirements-dev.txt - name: Run coverage and extract percentage id: coverage run: | - python -m coverage run -m unittest discover -t . -s tests/unit > /dev/null 2>&1 || true - PERCENT=$(python -m coverage report 2>/dev/null | grep '^TOTAL' | grep -oP '\d+(?=%)' | tail -1) + python3 -m coverage run -m unittest discover -t . -s tests/unit > /dev/null 2>&1 || true + PERCENT=$(python3 -m coverage report 2>/dev/null | grep '^TOTAL' | grep -oP '\d+(?=%)' | tail -1) echo "percent=$PERCENT" >> $GITHUB_OUTPUT echo "Coverage: $PERCENT%" @@ -45,7 +42,7 @@ jobs: # the single source of truth in scripts/critical-modules.txt; every # core module is unit-tested, so the unit-only run is accurate for it. INCLUDE=$(grep -vE '^[[:space:]]*(#|$)' scripts/critical-modules.txt | paste -sd, -) - PERCENT=$(python -m coverage report --include="$INCLUDE" 2>/dev/null | grep '^TOTAL' | grep -oP '\d+(?=%)' | tail -1) + PERCENT=$(python3 -m coverage report --include="$INCLUDE" 2>/dev/null | grep '^TOTAL' | grep -oP '\d+(?=%)' | tail -1) echo "percent=$PERCENT" >> $GITHUB_OUTPUT echo "Core coverage: $PERCENT%"