bnjbvr / cargo-machete

Remove unused Rust dependencies with this one weird trick!
MIT License
808 stars 30 forks source link

actions-rs/cargo@v1 use Node12. Please update the following actions to use Node.js 16 #98

Closed istellino-chub closed 11 months ago

istellino-chub commented 11 months ago

Hello there, This action is using Node12 which is deprecated https://github.com/bnjbvr/cargo-machete/blob/881ee93cb16f717244d963d9c46f2fd3884048bb/action.yml#L11C29-L11C29 . Would you consider to replace it with another option like https://github.com/clechasseur/rs-cargo ?

bnjbvr commented 11 months ago

Hi! Not sure, is it a problem that CI's using an old version of Node? This action was just a cache for the binary I suppose, happy to use anything else that'd be as simple and well maintained.

istellino-chub commented 11 months ago

For example if I add this to a git workflow:

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Machete
        uses: bnjbvr/cargo-machete@main

I will get this warning The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

bnjbvr commented 11 months ago

Alrighty then, using the one you linked in the first comment sounds good to me :+1: Would you be willing to provide a PR?

istellino-chub commented 11 months ago

Alrighty then, using the one you linked in the first comment sounds good to me 👍 Would you be willing to provide a PR?

If you can review https://github.com/bnjbvr/cargo-machete/pull/99 . Also if you have a way to test it and make sure it works let me know. I was not sure how to test this.

bnjbvr commented 11 months ago

Code lgtm. To test it, you should be able to replace in your own config file something like:

 - uses: bnjbvr/cargo-machete@main

to

 - uses: istellino-chub/cargo-machete@fix-node12-warning

and run that in a PR so as to trigger the build. Once you've done that, can you paste a link of the CI run here please? Thanks in advance.

istellino-chub commented 11 months ago

Code lgtm. To test it, you should be able to replace in your own config file something like:

 - uses: bnjbvr/cargo-machete@main

to

 - uses: istellino-chub/cargo-machete@fix-node12-warning

and run that in a PR so as to trigger the build. Once you've done that, can you paste a link of the CI run here please? Thanks in advance.

@bnjbvr I tested following your instructions replacing it on our workflow file and works fine. I cannot paste the CI run because is a private repo

bnjbvr commented 11 months ago

https://github.com/bnjbvr/rustatouille/actions/runs/7412912153/job/20170714796 is a successful run.

bnjbvr commented 11 months ago

Fixed by https://github.com/bnjbvr/cargo-machete/pull/99