Skip to content
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

506 switch to stable rust toolchain channel #513

Merged
merged 39 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a12299e
initial push
b-yap Apr 18, 2024
4378c18
fix unused implementor in `reward-distribution`,
b-yap Apr 18, 2024
894b4c4
* wrap Amount in another trait (in redeem pallet) to be able to mock it
b-yap Apr 19, 2024
3c210d0
go to previous day nightly version
b-yap Apr 19, 2024
9e6667b
set override to false
b-yap Apr 19, 2024
2ebfb92
specific toolchain
b-yap Apr 22, 2024
e7fed7a
fix clippy issues;
b-yap Apr 22, 2024
bfe682a
do not allow parallel
b-yap Apr 22, 2024
b50dc98
`--lib`, not `--libs`
b-yap Apr 22, 2024
69a1f5f
fix nightly ci
b-yap Apr 23, 2024
2867ed4
fix nightly ci
b-yap Apr 23, 2024
5ed5567
convert to lib
b-yap Apr 23, 2024
13b1ba2
fix clippy command and install nightly using `dtolnay`
b-yap Apr 23, 2024
8001c1c
fix nightly CI
b-yap Apr 23, 2024
41c94f6
use a newer nightly toolchain and update readme;
b-yap Apr 23, 2024
46534cb
fix warnings and use and older toolchain because of `The 'cargo' bina…
b-yap Apr 23, 2024
4c57a15
use new version
b-yap Apr 23, 2024
d6aed06
change all .md to run tests with `+nightly`
b-yap Apr 23, 2024
a777d8d
applied cargo fmt
b-yap Apr 24, 2024
f79f777
specify the nightly version in readmes;
b-yap Apr 29, 2024
2eca28d
FIX YAML FILE
b-yap Apr 29, 2024
7be4923
revert yaml file
b-yap Apr 29, 2024
ca79253
https://github.com/pendulum-chain/spacewalk/actions/runs/8876331480/j…
b-yap Apr 29, 2024
70edc47
no need to define the nightly version
b-yap Apr 30, 2024
7232fc0
revert `testing-utils` of pallet `currency`, and build packages indiv…
b-yap May 2, 2024
a00739a
https://github.com/pendulum-chain/spacewalk/pull/513#discussion_r1582…
b-yap May 2, 2024
b7e7052
fix https://github.com/pendulum-chain/spacewalk/actions/runs/89221941…
b-yap May 2, 2024
4948b1e
https://github.com/pendulum-chain/spacewalk/pull/513#discussion_r1587…
b-yap May 2, 2024
f714d73
Update .github/workflows/ci-dev.yml
b-yap May 2, 2024
e9c89db
https://github.com/pendulum-chain/spacewalk/actions/runs/8922961363/j…
b-yap May 2, 2024
461939e
https://github.com/pendulum-chain/spacewalk/actions/runs/8924275855/j…
b-yap May 2, 2024
bfec52e
uncomment all lines
b-yap May 2, 2024
eb2f12d
had to remove `service` as it requires a companion lib: the `runtime`.
b-yap May 2, 2024
1709860
https://github.com/pendulum-chain/spacewalk/actions/runs/8926871185/j…
b-yap May 2, 2024
fc0729a
https://github.com/pendulum-chain/spacewalk/actions/runs/8927530752/j…
b-yap May 6, 2024
f17cd14
https://github.com/pendulum-chain/spacewalk/pull/513#pullrequestrevie…
b-yap May 6, 2024
2cd69c2
fix rewards-distribution test issue
b-yap May 6, 2024
20967da
https://github.com/pendulum-chain/spacewalk/pull/513#discussion_r1590…
b-yap May 7, 2024
1a5c3d6
revise description of `cmd-all`
b-yap May 7, 2024
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
39 changes: 30 additions & 9 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
max-parallel: 1
matrix:
os: [ ubuntu-latest, macos-latest ]
rust: [stable, nightly]
include:
- os: ubuntu-latest
sccache-path: /home/runner/.cache/sccache
Expand Down Expand Up @@ -54,9 +55,28 @@ jobs:
brew install sccache

- name: Setup Rust toolchain
if: matrix.rust == 'stable'
# Call `rustup show` as a hack so that the toolchain defined in rust-toolchain.toml is installed
run: rustup show

- name: Remove rust-toolchain.toml for nightly
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing the nightly (and even setting it to default) will still be overriden by the rust-toolchain.toml file, hence it needs to be removed.
See https://github.com/pendulum-chain/spacewalk/actions/runs/8751187110/job/24020665297#step:9:33

if: matrix.rust == 'nightly'
# To make sure that the nightly version will be used all throughout
run: |
rm /home/runner/work/spacewalk/spacewalk/rust-toolchain.toml

- name: Setup nightly Rust toolchain
if: matrix.rust == 'nightly'
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-02-09
components: rustfmt, clippy
target: wasm32-unknown-unknown

- name: Setup nightly Rust as default
if: matrix.rust == 'nightly'
run: rustup default nightly-2024-02-09

- name: Use Cache
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -75,38 +95,39 @@ jobs:
- name: Start sccache server
run: sccache --start-server


- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Check Build
if: matrix.rust == 'stable'
run: |
bash ./scripts/cmd-all build check

- name: Test
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
env:
env:
SOURCE_STELLAR_SECRET_MAINNET: ${{ secrets.SOURCE_STELLAR_SECRET_MAINNET }}
SOURCE_STELLAR_SECRET_TESTNET: ${{ secrets.SOURCE_STELLAR_SECRET_TESTNET }}
DEST_STELLAR_SECRET_MAINNET: ${{ secrets.DEST_STELLAR_SECRET_MAINNET }}
DEST_STELLAR_SECRET_TESTNET: ${{ secrets.DEST_STELLAR_SECRET_TESTNET }}
with:
toolchain: nightly-2024-02-09
command: test
args: --all --all-features

- name: Rustfmt
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-02-09
command: fmt
args: --all -- --check

- name: Print sccache stats
run: sccache --show-stats

- name: Stop sccache server
run: sccache --stop-server || true

run: sccache --stop-server || true
56 changes: 41 additions & 15 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
name: continuous-integration-main
jobs:
ci:
strategy:
max-parallel: 1
matrix:
rust: [stable, nightly]
runs-on: ubuntu-20.04
env:
RUST_BACKTRACE: full
Expand Down Expand Up @@ -36,10 +40,29 @@ jobs:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev

- name: Setup Rust toolchain
- name: Setup stable Rust toolchain
if: matrix.rust == 'stable'
# Call `rustup show` as a hack so that the toolchain defined in rust-toolchain.toml is installed
run: rustup show

- name: Remove rust-toolchain.toml for nightly
if: matrix.rust == 'nightly'
# To make sure that the nightly version will be used all throughout
run: |
rm /home/runner/work/spacewalk/spacewalk/rust-toolchain.toml

- name: Setup nightly Rust toolchain
ebma marked this conversation as resolved.
Show resolved Hide resolved
if: matrix.rust == 'nightly'
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-02-09
ebma marked this conversation as resolved.
Show resolved Hide resolved
components: rustfmt, clippy
target: wasm32-unknown-unknown

- name: Setup nightly Rust as default
if: matrix.rust == 'nightly'
run: rustup default nightly-2024-02-09

- name: Use Cache
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -52,38 +75,41 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Check Build
if: matrix.rust == 'stable'
run: |
bash ./scripts/cmd-all build check

- name: Test
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
env:
env:
SOURCE_STELLAR_SECRET_MAINNET: ${{ secrets.SOURCE_STELLAR_SECRET_MAINNET }}
SOURCE_STELLAR_SECRET_TESTNET: ${{ secrets.SOURCE_STELLAR_SECRET_TESTNET }}
DEST_STELLAR_SECRET_MAINNET: ${{ secrets.DEST_STELLAR_SECRET_MAINNET }}
DEST_STELLAR_SECRET_TESTNET: ${{ secrets.DEST_STELLAR_SECRET_TESTNET }}
with:
toolchain: nightly-2024-02-09
command: test
args: --all --all-features

- name: Rustfmt
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-02-09
command: fmt
args: --all -- --check

- name: Clippy -- Main
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -W clippy::all -A clippy::style -A clippy::forget_copy -A clippy::forget_ref
- name: Clippy -- Libraries and Binaries
if: matrix.rust == 'stable'
run: |
bash ./scripts/cmd-all clippy "clippy --lib --bins" "-- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references"

- name: Clippy -- All Targets
- name: Clippy -- Tests and Examples
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-02-09
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --all-features --all-targets -- -A clippy::all -W clippy::correctness -A clippy::forget_copy -A clippy::forget_ref
args: --all-features --tests --benches --examples -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references
Loading
Loading