Skip to content

Commit

Permalink
Use toolchain from toml file
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga authored Nov 8, 2023
1 parent eed117c commit d03c379
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
14 changes: 9 additions & 5 deletions .github/actions/prep-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ runs:
df -h
sudo apt-get install protobuf-compiler
- name: Install latest nightly
uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746
with:
toolchain: ${{ inputs.RUST_TOOLCHAIN }}
default: true
# - name: Install latest nightly
# uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746
# with:
# toolchain: ${{ inputs.RUST_TOOLCHAIN }}
# default: true
- name: Install toolchain from rust-toolchain.toml
run: |
TOOLCHAIN_VERSION=$(grep 'channel =' rust-toolchain.toml | awk -F'"' '{print $2}')
rustup toolchain install "$TOOLCHAIN_VERSION"
- name: SCcache setup
if: ${{ inputs.cache == 'enabled' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/benchmark-auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
runtimes: [centrifuge, altair]
env:
RUST_TOOLCHAIN: "1.66.0"
# RUST_TOOLCHAIN: "1.66.0"
RUSTC_WRAPPER: "sccache"
steps:
- name: Checkout code
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Prep build on Ubuntu
uses: ./.github/actions/prep-ubuntu
with:
RUST_TOOLCHAIN: ${{ env.RUST_TOOLCHAIN }}
# RUST_TOOLCHAIN: ${{ env.RUST_TOOLCHAIN }}
cache: enabled
# Cache needs Google credentials:
GWIP: ${{ secrets.GWIP_SCCACHE }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# package: [centrifuge-runtime, altair-runtime]
target: [build-runtime, build-runtime-fast]
package: [altair-runtime, centrifuge-runtime]
rust_version: ["1.66.0"]
# rust_version: ["1.66.0"]
name: ${{ matrix.target }}-${{ matrix.package }}
# Cannot make sccache work with the srtool container
# env:
Expand All @@ -39,8 +39,9 @@ jobs:

- name: Prep build on Ubuntu
uses: ./.github/actions/prep-ubuntu
with:
RUST_TOOLCHAIN: ${{ matrix.rust_version }}
# Use default toolchain
# with:
# RUST_TOOLCHAIN: ${{ matrix.rust_version }}

# sccache does not work inside the srtool container
- uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # 2.6.2
Expand Down
4 changes: 1 addition & 3 deletions docker/centrifuge-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ FROM --platform=linux/amd64 docker.io/library/ubuntu:22.04 as builder
rm rustup-init;

# BUILD
ARG RUST_TOOLCHAIN="1.66"
ARG RUSTC_WRAPPER=''
ARG SCCACHE_GHA_ENABLED="false"

RUN rustup default $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
RUN rustup target add wasm32-unknown-unknown

COPY . centrifuge-chain
WORKDIR /centrifuge-chain
Expand Down

0 comments on commit d03c379

Please sign in to comment.