diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 9391ad158..603dd8922 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -1,16 +1,12 @@ -name: Tests +name: Tests on: - push: - branches: [ main ] pull_request: branches: [ main ] jobs: test: - runs-on: ubuntu-latest - container: - image: xiaoxia-ci-python:3.12 + runs-on: runtime-builder steps: - name: Checkout code @@ -61,9 +57,7 @@ jobs: PYTHONPATH="$PWD/apps/api:$PWD" python -m pytest tests/unit -q lint: - runs-on: ubuntu-latest - container: - image: xiaoxia-ci-python:3.12 + runs-on: runtime-builder steps: - name: Checkout code diff --git a/infra/docker/api.Dockerfile b/infra/docker/api.Dockerfile index be3e3bfc0..bb249bb53 100644 --- a/infra/docker/api.Dockerfile +++ b/infra/docker/api.Dockerfile @@ -34,7 +34,7 @@ COPY packages/ /app/packages/ COPY alembic.ini /app/alembic.ini COPY migrations/ /app/migrations/ COPY alembic/ /app/alembic/ -COPY scripts/validate_release_env.py /app/scripts/validate_release_env.py +COPY scripts/ /app/scripts/ # 设置环境变量 ENV PATH="/opt/venv/bin:$PATH" diff --git a/infra/docker/compose.yml b/infra/docker/compose.yml index eda34ec78..5bbbaee69 100644 --- a/infra/docker/compose.yml +++ b/infra/docker/compose.yml @@ -52,7 +52,7 @@ services: environment: APP_ENV: ${APP_ENV:-staging} - APP_VERSION: ${APP_VERSION:-0.1.0} + APP_VERSION: ${APP_VERSION} GENERATED_FILES_DIR: /app/generated GENERATED_FILES_URL_PREFIX: /generated-files PUBLIC_API_BASE_URL: ${PUBLIC_API_BASE_URL:-https://api.xiaoxiajianji.com} @@ -87,7 +87,7 @@ services: resources: limits: cpus: '2.0' - memory: 2G + memory: 2g reservations: cpus: '0.5' memory: 512M @@ -106,7 +106,7 @@ services: environment: APP_ENV: ${APP_ENV:-staging} - APP_VERSION: ${APP_VERSION:-0.1.0} + APP_VERSION: ${APP_VERSION} WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-1} WORKER_MAX_TASKS_PER_CHILD: ${WORKER_MAX_TASKS_PER_CHILD:-100} GENERATED_FILES_DIR: /app/generated @@ -137,7 +137,7 @@ services: resources: limits: cpus: '2.0' - memory: 2G + memory: 2g reservations: cpus: '0.5' memory: 1G @@ -210,3 +210,4 @@ networks: external: true # 注意: 必须先创建网络 # docker network create xiaoxia-net +