Skip to content

CI: Simplify rustup usage #4075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install Rust
run: |
rustup set profile minimal
rustup update 1.56.0
rustup default 1.56.0

- run: rustup default 1.56.0
- run: rustup component add rustfmt
- run: rustup component add clippy

Expand Down Expand Up @@ -123,26 +118,8 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cleanup pre-installed Rust toolchains
# The pre-installed toolchain is under root permission, and this would
# make tarball fail to extract. Here we remove the symlink and install
# our own Rust toolchain if necessary.
run: |
which rustup
which cargo
if [[ -L "$HOME/.cargo" && -L "$HOME/.rustup" ]]; then
rm -v "$HOME/.rustup"
rm -v "$HOME/.cargo"
fi
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Install ${{ matrix.rust }} Rust
run: |
if [[ ! -d "$HOME/.cargo" || ! -d "$HOME/.rustup" ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
fi
rustup set profile minimal
rustup update ${{ matrix.rust }}
rustup default ${{ matrix.rust }}

Expand Down