ci: fix checkout (no Node in python:slim) + setup-python + WeasyPrint libs
Le job test tournait dans un container python:3.12-slim sans Node.js, donc l'action JavaScript actions/checkout@v4 echouait des la 1ere seconde pour tous les commits. On retire le container (image par defaut du runner = Node dispo), on installe Python 3.12 via actions/setup-python@v5, les libs natives WeasyPrint et on supprime le re-run complet de la suite dans le resume.
This commit is contained in:
+18
-4
@@ -9,10 +9,24 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container: python:3.12-slim
|
||||
# NOTE: no `container:` here. A `python:*-slim` image ships no Node.js, so the
|
||||
# JavaScript `actions/checkout` action could not run and every job failed at
|
||||
# the first step. The runner's default image already provides Node; we install
|
||||
# the Python toolchain explicitly with actions/setup-python.
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install system dependencies (WeasyPrint / emoji fonts)
|
||||
run: |
|
||||
SUDO=""
|
||||
if command -v sudo >/dev/null 2>&1; then SUDO="sudo"; fi
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y --no-install-recommends \
|
||||
libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b libffi-dev \
|
||||
libjpeg-dev libopenjp2-7 libcairo2 fonts-noto-color-emoji
|
||||
- name: Install Python dependencies
|
||||
run: pip install -r requirements.txt pytest pytest-cov
|
||||
- name: Run tests with coverage
|
||||
env:
|
||||
@@ -21,8 +35,8 @@ jobs:
|
||||
APP_SECRET_KEY: ci-test-key
|
||||
run: python -m pytest tests/ -v --tb=short --cov=app --cov-report=term
|
||||
- name: Coverage summary
|
||||
run: |
|
||||
python -m pytest tests/ --cov=app --cov-report=term 2>&1 | tail -20
|
||||
if: always()
|
||||
run: coverage report -m || true
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user