ci: use aliyun rust mirror container
Some checks failed
CI / check (push) Failing after 1s
CI / build (push) Has been skipped

This commit is contained in:
xfy 2026-06-12 17:03:38 +08:00
parent 4ae7b38131
commit 8014e202f8

View File

@ -7,12 +7,13 @@ on:
branches: [main, master] branches: [main, master]
env: env:
RUSTUP_UPDATE_ROOT: https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup CARGO_NET_OFFLINE: false
RUSTUP_DIST_SERVER: https://mirrors.tuna.tsinghua.edu.cn/rustup
jobs: jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: registry.cn-hangzhou.aliyuncs.com/library/rust:bookworm
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
@ -24,7 +25,7 @@ jobs:
- name: Configure Cargo mirror - name: Configure Cargo mirror
run: | run: |
mkdir -p "$HOME/.cargo" mkdir -p "$HOME/.cargo"
cat > "$HOME/.cargo/config.toml" <>EOF cat > "$HOME/.cargo/config.toml" <<EOF
[source.crates-io] [source.crates-io]
replace-with = 'ustc' replace-with = 'ustc'
@ -32,11 +33,6 @@ jobs:
registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/" registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/"
EOF EOF
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Node.js - name: Install Node.js
run: | run: |
apt-get update apt-get update
@ -65,10 +61,11 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: registry.cn-hangzhou.aliyuncs.com/library/rust:bookworm
needs: check needs: check
env: env:
RUSTUP_UPDATE_ROOT: https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup CARGO_NET_OFFLINE: false
RUSTUP_DIST_SERVER: https://mirrors.tuna.tsinghua.edu.cn/rustup
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
@ -80,7 +77,7 @@ jobs:
- name: Configure Cargo mirror - name: Configure Cargo mirror
run: | run: |
mkdir -p "$HOME/.cargo" mkdir -p "$HOME/.cargo"
cat > "$HOME/.cargo/config.toml" <>EOF cat > "$HOME/.cargo/config.toml" <<EOF
[source.crates-io] [source.crates-io]
replace-with = 'ustc' replace-with = 'ustc'
@ -88,11 +85,6 @@ jobs:
registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/" registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/"
EOF EOF
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Node.js - name: Install Node.js
run: | run: |
apt-get update apt-get update