fix: align Docker Python version with pinned dependencies

This commit is contained in:
tifisht
2026-10-26 08:13:17 +08:00
parent da2c3d4cfc
commit fcbb409a12
4 changed files with 67 additions and 3 deletions
+64
View File
@@ -0,0 +1,64 @@
name: Docker smoke test
on:
push:
paths:
- Dockerfile
- .dockerignore
- docker-compose.yml
- entrypoint.sh
- requirements.txt
- '*.py'
- templates/**
- .github/workflows/docker-smoke.yml
pull_request:
paths:
- Dockerfile
- .dockerignore
- docker-compose.yml
- entrypoint.sh
- requirements.txt
- '*.py'
- templates/**
- .github/workflows/docker-smoke.yml
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-start:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Build image and check dependencies
run: |
docker build --tag netease-url:smoke .
docker run --rm netease-url:smoke python3 -m pip check
docker run --rm netease-url:smoke ffmpeg -version
- name: Start service without account credentials
run: |
touch "$RUNNER_TEMP/netease-cookie.txt"
docker run --detach --name netease-url-smoke \
--publish 127.0.0.1:5000:5000 \
--mount "type=bind,src=$RUNNER_TEMP/netease-cookie.txt,dst=/app/cookie.txt,readonly" \
netease-url:smoke
curl --fail --silent --show-error --retry 30 --retry-connrefused \
--retry-delay 1 --max-time 5 http://127.0.0.1:5000/health > health.json
python3 - <<'PY'
import json
with open('health.json') as response:
health = json.load(response)
assert health['success'] is True, health
assert health['data']['service'] == 'running', health
assert health['data']['cookie_count'] == 0, health
PY
- name: Show service logs and remove container
if: always()
run: |
docker logs netease-url-smoke 2>/dev/null || true
docker rm --force netease-url-smoke 2>/dev/null || true