From 672094484c5bbbfe24bb094180dc36f37038e7fc Mon Sep 17 00:00:00 2001 From: chenwj113 Date: Wed, 21 Aug 2024 16:29:44 +0800 Subject: [PATCH] fix: --- action.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/action.yml b/action.yml index 3823ccb..5f2fd3e 100644 --- a/action.yml +++ b/action.yml @@ -112,6 +112,41 @@ runs: if [[ ! -v RUSTUP_UPDATE_ROOT ]]; then echo "RUSTUP_UPDATE_ROOT=https://rsproxy.cn/rustup" >> $GITHUB_ENV fi + if [[ ! -f ~/.cargo/config ]]; then + mkdir -p ~/.cargo + cat > ~/.cargo/config < /dev/null ; then + curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://rsproxy.cn/rustup-init.exe" -o rustup-init.exe + powershell -Command .\rustup-init.exe -y + fi + + - name: Cache Rust toolchain + uses: actions/cache@v3 + env: + cache_key: ${{ runner.os }}-rustup-${{ runner.arch }}-${{ runner.temp }}-${{ hashFiles('**/rust-toolchain', '**/rust-toolchain.toml') }} + with: + path: ${{ runner.temp }}/cargo-home - name: Install Rust Problem Matcher if: inputs.matcher == 'true'