Skip to content

Commit

Permalink
ci: replace Rust toolchain with actions-rust-lang/setup-rust-toolchai…
Browse files Browse the repository at this point in the history
…n@v1

The original way to install rust dependency will not check if rust is
already installed, thus it would require `rustup` be installed on the
ci machine already while self-hosted CI machine may not.

We use `actions-rust-lang/setup-rust-toolchain@v1` to install rust
because `actions-rs` has not been maintained for over 1 year and is
archived.

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Oct 16, 2024
1 parent ff2c474 commit b3bf5fd
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/as-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust toolchain (${{ env.RUSTC_VERSION }})
run: |
rustup update --no-self-update ${{ env.RUSTC_VERSION }}
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustc
rustup default ${{ env.RUSTC_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
components: rustfmt, clippy

- uses: actions/setup-go@v5
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/as-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
sudo apt-get install -y libsgx-dcap-quote-verify-dev libsgx-dcap-default-qpl
- name: Install Rust toolchain (${{ env.RUSTC_VERSION }})
run: |
rustup update --no-self-update ${{ env.RUSTC_VERSION }}
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustfmt rustc clippy
rustup default ${{ env.RUSTC_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
components: rustfmt, clippy

- name: Build
working-directory: attestation-service
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/kbs-docker-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust ${{ env.RUSTC_VERSION }} (for client)
run: |
rustup update --no-self-update ${{ env.RUSTC_VERSION }}
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustc
rustup default ${{ env.RUSTC_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
components: rustfmt, clippy

- name: Build client
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/kbs-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ jobs:
run: tar xzf ./artifact/${{ inputs.tarball }}

- name: Install Rust toolchain (${{ env.RUSTC_VERSION }})
run: |
rustup update --no-self-update ${{ env.RUSTC_VERSION }}
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustc
rustup default ${{ env.RUSTC_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
components: rustfmt, clippy
rustflags: ""

- name: Set up rust build cache
uses: actions/cache@v4
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/kbs-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust toolchain (${{ env.RUSTC_VERSION }})
run: |
rustup update --no-self-update ${{ env.RUSTC_VERSION }}
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustfmt rustc clippy
rustup target add x86_64-unknown-linux-gnu
rustup default ${{ env.RUSTC_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
components: rustfmt, clippy

- name: Building dependencies installation
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push-kbs-client-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust toolchain (${{ env.RUSTC_VERSION }})
run: |
rustup update --no-self-update ${{ env.RUSTC_VERSION }}
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustc
rustup default ${{ env.RUSTC_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
components: rustfmt, clippy

- name: Log in to ghcr.io
uses: docker/login-action@v3
Expand Down

0 comments on commit b3bf5fd

Please sign in to comment.