actions-rs / toolchain

🛠️ GitHub Action for `rustup` commands
https://github.com/marketplace/actions/rust-toolchain
MIT License
585 stars 86 forks source link

Properly remove all deprecations #224

Open ThexXTURBOXx opened 1 year ago

ThexXTURBOXx commented 1 year ago

This PR supersedes #220 and #222 by applying both fixes at once

Fixes #219 Fixes #221

You can now use this action (and cargo) without deprecations by using a workflow similar to this:

on: [push]

name: build

jobs:
  check:
    name: Rust project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install latest nightly
        uses: ThexXTURBOXx/toolchain@master
        with:
            toolchain: nightly
            override: true
            components: rustfmt, clippy

      # `cargo check` command here will use installed `nightly`
      # as it is set as an "override" for current directory

      - name: Run cargo check
        uses: richb-hanover/cargo@master
        with:
          command: check
Roms1383 commented 1 year ago

any ETA on this ?

ThexXTURBOXx commented 1 year ago

@Roms1383 I am pretty sure this will not get merged any time soon. I also did not just want to steal the work from the other two PRs. The reason for this PR is the following: You can now use this action (and cargo) without deprecations by using a workflow similar to this:

on: [push]

name: build

jobs:
  check:
    name: Rust project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install latest nightly
        uses: ThexXTURBOXx/toolchain@master
        with:
            toolchain: nightly
            override: true
            components: rustfmt, clippy

      # `cargo check` command here will use installed `nightly`
      # as it is set as an "override" for current directory

      - name: Run cargo check
        uses: richb-hanover/cargo@master
        with:
          command: check
striezel commented 1 year ago

any ETA on this ?

I do not believe this will get merge anytime soon - maybe not at all. :(

In the meantime, users of this action may consider using dtolnay/rust-toolchain instead. It is maintained and does not cause any deprecation warnings. Usage is similar to actions-rs/toolchain, so it can be used as a replacement:

name: test suite
on: [push, pull_request]

jobs:
  test:
    name: cargo test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
          components: clippy, rustfmt
      - run: cargo clippy
      - run: cargo fmt
      - run: cargo test --all-features