From abb43cf2e406910d077c94e8dd242380e779e449 Mon Sep 17 00:00:00 2001 From: openbot-coder Date: Tue, 27 Oct 2026 18:30:15 +0800 Subject: [PATCH] =?UTF-8?q?ci(gitea):=20=E6=96=B0=E5=A2=9E=E7=BA=AF=20run:?= =?UTF-8?q?=20=E7=9A=84=E7=B2=BE=E7=AE=80=E6=B5=8B=E8=AF=95=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=BA=BF=EF=BC=88=E8=A7=84=E9=81=BF=20node24=20action?= =?UTF-8?q?=20=E4=B8=8D=E5=85=BC=E5=AE=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yml | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..c5c58e3 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,60 @@ +name: Gitea Test + +# Gitea 侧的「精简校验」流水线。 +# +# 为什么一个 `uses:` 都不用: +# 本实例的 runner 是 forgejo-runner v7.0.0,其内置 act 只支持到 node20 action; +# 而 actions/checkout@v7、astral-sh/setup-uv@v10 等已切到 node24,会在 Checkout +# 阶段直接报 "must be one of: [composite docker node12 node16 node20 go sh], got node24" +# 并让整个 job 的所有 step 变成 cancelled。所以这里用 `run:` 手写等价逻辑。 +# +# 职责分工: +# - Gitea(本文件):单版本快速反馈,只跑 pytest +# - GitHub(.github/workflows/ci.yml + release.yml):完整矩阵 + 构建校验 + PyPI 发布 +# (PyPI Trusted Publishing 依赖 GitHub 的 OIDC 令牌,Gitea 签不出来,无法迁移) + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + name: pytest (Python ${{ matrix.python }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # 只跑一个版本:快速反馈,完整矩阵交给 GitHub + python: ["3.13"] + steps: + - name: Fetch source + run: | + set -euo pipefail + git clone --depth 1 --branch "${GITHUB_REF_NAME}" \ + https://api.vxquant.com/git/vxquant/pytdxdata.git . + git log -1 --oneline + + - name: Install uv + run: | + set -euo pipefail + export PATH="$HOME/.local/bin:$PATH" + if ! command -v uv >/dev/null 2>&1; then + curl -LsSf https://astral.sh/uv/install.sh | sh + fi + export PATH="$HOME/.local/bin:$PATH" + uv --version + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + + - name: Sync dependencies + run: | + set -euo pipefail + uv sync --locked + + - name: Run tests + run: | + set -euo pipefail + uv run pytest -q