Skip to content

Commit a8c6649

Browse files
committed
update build.yml
1 parent 85c0287 commit a8c6649

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ jobs:
4343
git clone https://github.com/LearningOS/rCore-Tutorial-Checker-2025S.git ci-user
4444
git clone https://github.com/LearningOS/rCore-Tutorial-Test-2025S.git ci-user/user
4545
46-
# --- 使用环境变量强制指定镜像源 ---
47-
export CARGO_SOURCE_CRATES_IO_REPLACE_WITH='tuna'
48-
export CARGO_REGISTRIES_TUNA_INDEX='https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git'
49-
# --- 结束 ---
46+
ID=`git rev-parse --abbrev-ref HEAD | grep -oP 'ch\K[0-_]'`
47+
48+
# 直接将环境变量作为 make 命令的前缀,以保证最高优先级
49+
cd ci-user && \
50+
CARGO_SOURCE_CRATES_IO_REPLACE_WITH='tuna' \
51+
CARGO_REGISTRIES_TUNA_INDEX='https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git' \
52+
make test CHAPTER=$ID passwd=${{ secrets.BASE_TEST_TOKEN }} > ../output.txt
5053
51-
ID=`git rev-parse --abbrev-ref HEAD | grep -oP 'ch\K[0-9]'`
52-
cd ci-user && make test CHAPTER=$ID passwd=${{ secrets.BASE_TEST_TOKEN }} > ../output.txt
5354
cat ../output.txt
5455
5556
- name: end

0 commit comments

Comments
 (0)