Skip to content

Commit

Permalink
ci: make consistency of toolchain version in ci files (#341)
Browse files Browse the repository at this point in the history
* fix: patch valid source check

* fix: fix ci pipeline

* fix: fix ci pipeline

* fix: fix ci pipeline

* ci: use rust-toochain.toml

* ci: use rust-toochain.toml

* ci: update rust version

* ci: minor

* ci: cleanup

* ci: update in release file

---------

Co-authored-by: gcranju <[email protected]>
Co-authored-by: ibrizsabin <[email protected]>
  • Loading branch information
3 people authored Jul 25, 2024
1 parent a883375 commit 092c549
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 67 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/basic-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
push:
branches:
- main

jobs:

test:
Expand All @@ -23,23 +23,13 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install Rust
run: rustup update stable

- name: Lock Rust Version
run: rustup override set nightly-2023-03-27

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Run unit tests
run: |
RUST_BACKTRACE=1 cargo unit-test --locked
- name: Install wasm32
run: |
rustup target add wasm32-unknown-unknown
- name: Compile WASM contract
run: |
RUSTFLAGS='-C link-arg=-s' cargo wasm --locked
Expand All @@ -54,24 +44,9 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install Rust
run: rustup update stable

- name: Lock Rust Version
run: rustup override set nightly-2023-03-27

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-fmt
run: rustup component add --toolchain nightly-2023-03-27-x86_64-unknown-linux-gnu rustfmt

- name: Run cargo fmt
run: |
cargo fmt --all -- --check
- name: Install cargo-fmt
run: rustup component add --toolchain nightly-2023-03-27-x86_64-unknown-linux-gnu clippy

- name: Run cargo clippy
run: |
cargo clippy
13 changes: 0 additions & 13 deletions .github/workflows/build-and-publish-cosmwasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,8 @@ jobs:
with:
submodules: true

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
override: true
profile: minimal

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Compile WASM
run: |
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
bash ./scripts/optimize-cosmwasm.sh
- name: Archive artifacts
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/cosmwasm-contracts-code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update stable
- name: Lock Rust Version
run: rustup override set nightly-2023-03-27
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/deploy-cosmwasm-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,8 @@ jobs:
cp ./scripts/archway/docker_compose_archway.yaml .
docker compose -f docker_compose_archway.yaml up -d
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
override: true
profile: minimal

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Compile WASM
run: |
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
sudo chmod -R 777 artifacts
sudo chmod -R 777 scripts
bash ./scripts/optimize-cosmwasm.sh
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
override: true
profile: minimal
# - name: Install stable toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: 1.69.0
# target: wasm32-unknown-unknown
# override: true
# profile: minimal
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Compile WASM
run: |
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
# rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
# rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
bash ./scripts/optimize-cosmwasm.sh
cd artifacts/archway && zip -r ../../cosmwasm-contracts.zip . -j
Expand Down
5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
channel = "1.69.0"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
profile = "minimal"

0 comments on commit 092c549

Please sign in to comment.