Skip to content

Commit

Permalink
fix: manage rust toolchain version with vars (TabbyML#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys authored Nov 19, 2023
1 parent a12f741 commit ad9dbd5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
toolchain: ${{ vars.RUST_TOOLCHAIN }}

- name: Sccache cache
uses: mozilla-actions/[email protected]
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ vars.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
components: clippy

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}
build-args: |
RUST_TOOLCHAIN=${{ vars.RUST_TOOLCHAIN }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ARG CUDA_VERSION=11.7.1
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
# Target the CUDA runtime image
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
# Rust toolchain version
ARG RUST_TOOLCHAIN stable

FROM ${BASE_CUDA_DEV_CONTAINER} as build

Expand All @@ -22,7 +24,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# setup rust.
RUN curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain 1.73.0 -y
RUN curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain ${RUST_TOOLCHAIN} -y
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /root/workspace
Expand Down

0 comments on commit ad9dbd5

Please sign in to comment.