mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 04:06:44 +08:00
改为在 linux runner 中手动 fetch 当前提交,避免自托管 runner 准备阶段通过 gh-proxy 克隆 actions/checkout 和 dtolnay/rust-toolchain 时被 403 拦截,并同步开发文档与缺口说明。
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Gitea Actions workflow for the Rust workspace.
|
||||
# This workflow is linux-runner friendly and does not touch real resource
|
||||
# directories.
|
||||
# directories. It intentionally avoids external GitHub Actions so self-hosted
|
||||
# runners do not need to clone action repositories through a network proxy.
|
||||
|
||||
name: bat-rust
|
||||
|
||||
@@ -21,21 +22,35 @@ jobs:
|
||||
BAT_SKIP_ENV_FILE: "1"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
: "${GITHUB_SERVER_URL:?GITHUB_SERVER_URL is required}"
|
||||
: "${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is required}"
|
||||
: "${GITHUB_SHA:?GITHUB_SHA is required}"
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt,clippy
|
||||
repo_url="${GITHUB_SERVER_URL%/}/${GITHUB_REPOSITORY}.git"
|
||||
if [ -d .git ]; then
|
||||
git remote set-url origin "${repo_url}" 2>/dev/null || git remote add origin "${repo_url}"
|
||||
else
|
||||
git init .
|
||||
git remote add origin "${repo_url}"
|
||||
fi
|
||||
|
||||
ref="${GITHUB_REF:-${GITHUB_SHA}}"
|
||||
git fetch --no-tags --depth=1 origin "${ref}" || git fetch --no-tags --depth=1 origin "${GITHUB_SHA}"
|
||||
git checkout --force --detach FETCH_HEAD
|
||||
git submodule update --init --recursive
|
||||
|
||||
- name: Show tool versions
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
command -v git
|
||||
rustc --version
|
||||
cargo --version
|
||||
command -v curl
|
||||
command -v unzip
|
||||
rustfmt --version
|
||||
cargo clippy --version
|
||||
|
||||
- name: Check formatting
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user