bnjbvr/cargo-machete

Set up a Github Action that people can plain use in their projects

bnjbvr opened this issue ยท 12 comments

Probably the Github action could download the binary from the latest release, and then run machete. Maybe the action would have some parameters that are equivalent to the CLI flags and parameters.

Contributions would be appreciated :)

FWIW, I'm currently using this for my CI pipelines to ensure the app is cached/avoid rebuilds on every run:

  - name: Install cargo-machete
    uses: baptiste0928/cargo-install@v2
    with:
      crate: cargo-machete
  - name: Cargo machete
    run: cargo machete

I've also added support for cargo-machete to https://github.com/taiki-e/install-action.

  - uses: taiki-e/install-action@v2
    with:
      tool: cargo-machete

  - uses: actions-rs/cargo@v1
    with:
      command: machete
bnjbvr commented

Thanks all, looks like it's simple enough to set up cargo-machete via CI actions now. There aren't many CLI options to pass, so unless somebody wanted to customize the action at a higher level, it seems fine to me to use those other actions. Closing.

I came across this a bit too late, this was something I did: https://github.com/vsuryamurthy/cargo-machete-action today. But agreed that it is simple enough that this is not really necessary.

bnjbvr commented

@vsuryamurthy That looks great! Would you like to upstream this action in this repository? I'd be happy to pick up the maintenance, and add options for the few CLI flags that we have.

Alternatively, we could also publicize your or the other sets of actions in this project's README.

@vsuryamurthy That looks great! Would you like to upstream this action in this repository? I'd be happy to pick up the maintenance, and add options for the few CLI flags that we have.

Personally I find it hard when the actual package and its corresponding action are in different locations. So I would be happy to move the action here and help you maintain it as well.
How would you like to structure it though? As a separate directory called action?

bnjbvr commented

Sounds good, and I think that makes sense too: when updating the CLI options, it's simpler to update all things in one place.

How would you like to structure it though? As a separate directory called action?

If we can do that, and that doesn't make it harder to use, then it would be perfect indeed.

Sounds good, and I think that makes sense too: when updating the CLI options, it's simpler to update all things in one place.

How would you like to structure it though? As a separate directory called action?

If we can do that, and that doesn't make it harder to use, then it would be perfect indeed.

I will test it locally with my repository and get back to you.

@bnjbvr So it is possible to put it into a folder. The action if upstreamed would have a path like this
bnjbvr/cargo-machete/action@v1

bnjbvr commented

@vsuryamurthy Thanks for checking. What would it take to host it at the root? It would only add an extra actions.yml file to the root folder, if I understand correctly? If so, then I think we can do that ๐Ÿ‘

@vsuryamurthy Thanks for checking. What would it take to host it at the root? It would only add an extra actions.yml file to the root folder, if I understand correctly? If so, then I think we can do that ๐Ÿ‘

An actions.yml file and a readme update with explanation.

bnjbvr commented

That looks great, let's do that then!