Git Product home page Git Product logo

Comments (7)

dmontagu avatar dmontagu commented on May 24, 2024 6

Using the --manifest-path option to specify the Cargo.toml file seems to ensure the action works, but it doesn't seem to get the paths right (they are relative to where Cargo.toml lives, not the repository root), so the feedback can't be viewed from the files view of the PR. (Though they it does appear in the checks list.)

Any suggestions for a workaround?

from clippy-check.

mbStavola avatar mbStavola commented on May 24, 2024 3

It's really unfortunate that Github Actions doesn't support working-dir in a use context, huge oversight! Hopefully they can address it soon.

While they work on that though, for anyone who is having trouble using this Action because of that limitation, this might help:

clippy:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v1
    - run: rustup component add clippy
    - uses: actions-rs/clippy-check@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        args: --all-features --manifest-path path/to/Cargo.toml

--manifest-path allows you to essentially set the working dir of the crate, since it seems like the Clippy action runs relative to wherever the specified Cargo.toml lives.

from clippy-check.

svartalf avatar svartalf commented on May 24, 2024

I might miss something here, but would not working-directory just work in this case too?

from clippy-check.

mrowqa avatar mrowqa commented on May 24, 2024

When you define a step, you can use either run or uses. You can specify working-directory only if you choose run - and when you look at the documentation, it's mentioned only there. I tried to use it with uses, but unfortunately after applying some ideas I didn't manage to get it working - sometimes it was ignored, sometimes it caused a workflow format error.

from clippy-check.

svartalf avatar svartalf commented on May 24, 2024

Ah, yes, you are right, my mistake. It feels, though, that GitHub should support that on a global level, as re-implementing the same thing each time in every Action feels quite redundant.

Maybe it worth to file an issue to GitHub?

from clippy-check.

mrowqa avatar mrowqa commented on May 24, 2024

I see your point. I didn't know where I should file an issue, so I sent an email to [email protected].

from clippy-check.

qwandor avatar qwandor commented on May 24, 2024

The problem with the --manifest-path approach is that it doesn't use the .cargo/config under the crate directory. This may be a problem if it specifies a different build.target than the default, e.g. for embedded software that only builds on a particular architecture.

from clippy-check.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.