From 4138c737cefbe9e996a8e46df98f89baa88e7fe9 Mon Sep 17 00:00:00 2001 From: 237899745 <237899745@users.noreply.git.workyai.cn> Date: Sun, 26 Jul 2026 07:09:15 +0800 Subject: [PATCH] ci: remove external action dependencies --- .gitea/workflows/ci.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0e75ae5..58115ea 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -36,7 +36,17 @@ jobs: EXPECTED_EXTERNAL_TESTS: '10' steps: - name: Checkout - uses: actions/checkout@v4 + env: + GITEA_JOB_TOKEN: ${{ gitea.token }} + run: | + set -Eeuo pipefail + auth="$(printf 'x-access-token:%s' "$GITEA_JOB_TOKEN" | base64 | tr -d '\n')" + git init . + git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -c http.extraHeader="Authorization: Basic ${auth}" \ + fetch --no-tags --depth=1 origin "$GITHUB_REF" + git checkout --detach "$GITHUB_SHA" + test "$(git rev-parse HEAD)" = "$GITHUB_SHA" - name: Verify migration line endings run: | @@ -54,10 +64,16 @@ jobs: PY - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: '1.92' - components: rustfmt, clippy + run: | + set -Eeuo pipefail + curl --proto '=https' --tlsv1.2 --fail --silent --show-error \ + --location --retry 10 --retry-connrefused https://sh.rustup.rs \ + | sh -s -- -y --default-toolchain none --profile minimal + /root/.cargo/bin/rustup toolchain install 1.92 \ + --profile minimal --component rustfmt --component clippy --no-self-update + /root/.cargo/bin/rustup default 1.92 + echo /root/.cargo/bin >> "$GITHUB_PATH" + /root/.cargo/bin/rustc --version --verbose - name: Check Rust formatting run: cargo fmt --all -- --check @@ -78,11 +94,9 @@ jobs: run: cargo audit - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: npm - cache-dependency-path: frontend/package-lock.json + run: | + node --version | grep --extended-regexp '^v22\.' + npm --version - name: Build frontend working-directory: frontend