ci: pin Python 3.14 and stop depending on the runner's environment
Some checks failed
CI / naming (push) Successful in 28s
CI / frontend (push) Successful in 12s
CI / migrations-mysql (push) Failing after 15s
CI / backend (push) Successful in 4m7s

Three failures, all from the workflow inheriting whatever the runner
happened to have rather than declaring what it needs.

- backend ran pytest without installing it. pytest is in
  requirements-dev.txt, which nothing installed, so the step died with
  "No module named pytest".
- Both Python jobs used the runner's system interpreter. The old host
  executor had a matching Python by accident; a container image has
  3.10, where alembic additionally requires tomli. requirements.txt is
  hash-pinned and compiled on 3.14, so tomli has no hash and pip refuses
  the whole install under --require-hashes. 3.14 matches the Dockerfile,
  the README and the .github workflow.
- The utf8mb4 step shelled out to the mysql client, which is not in
  every runner image. pymysql is already a runtime dependency.
This commit is contained in:
2026-08-27 01:34:23 +00:00
parent 024751896e
commit 702861f1f9

View File

@@ -31,12 +31,23 @@ jobs:
steps: steps:
- name: Check out - name: Check out
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Python
# Pin the interpreter instead of inheriting the runner image's default.
# requirements.txt is hash-pinned and was compiled on 3.14; on an older
# Python, alembic additionally requires tomli, which has no hash in the
# lock file and pip then refuses the whole install.
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install dependencies - name: Install dependencies
run: | run: |
python3 --version python3 --version
python3 -m venv .venv python3 -m venv .venv
.venv/bin/pip install --upgrade pip .venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt .venv/bin/pip install -r requirements.txt
# pytest lives in requirements-dev.txt, not requirements.txt. Without
# this the test step dies with "No module named pytest".
.venv/bin/pip install -r requirements-dev.txt
- name: Run backend tests - name: Run backend tests
run: .venv/bin/python -m pytest run: .venv/bin/python -m pytest
@@ -83,15 +94,31 @@ jobs:
steps: steps:
- name: Check out - name: Check out
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Python
# Pin the interpreter instead of inheriting the runner image's default.
# requirements.txt is hash-pinned and was compiled on 3.14; on an older
# Python, alembic additionally requires tomli, which has no hash in the
# lock file and pip then refuses the whole install.
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install dependencies - name: Install dependencies
run: | run: |
python3 -m venv .venv python3 -m venv .venv
.venv/bin/pip install --upgrade pip .venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt .venv/bin/pip install -r requirements.txt
- name: Force utf8mb4 on the CI database - name: Force utf8mb4 on the CI database
# Uses pymysql, already a runtime dependency, rather than the mysql CLI,
# which is not present in every runner image.
run: | run: |
mysql -h 127.0.0.1 -uroot -proot -e \ .venv/bin/python - <<'PY'
"ALTER DATABASE shopdb_ci CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" import pymysql
c = pymysql.connect(host="127.0.0.1", port=3306, user="root", password="root")
with c.cursor() as cur:
cur.execute("ALTER DATABASE shopdb_ci CHARACTER SET utf8mb4 "
"COLLATE utf8mb4_unicode_ci")
c.close()
PY
- name: Fresh core upgrade from empty - name: Fresh core upgrade from empty
run: .venv/bin/flask db upgrade run: .venv/bin/flask db upgrade
- name: Install every bundled plugin (runs its chain) - name: Install every bundled plugin (runs its chain)