question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running cargo commands in a subdirectory?

See original GitHub issue

Do the checklist before filing an issue:

Motivation

My understanding is this github action only supports running cargo commands from the root of the repo. Is it possible to run cargo commands from a subdirectory? The motivation is that I have a monorepo that has projects that use different languages. I’d like to run cargo commands only for the rust projects.

Additional context

I’ve tried to set “working-directory” at the top level but that didn’t seem to work.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:63
  • Comments:9

github_iconTop GitHub Comments

9reactions
Gottoxcommented, Aug 3, 2020

This works around this issue. Nevertheless I think this is a bug.

8reactions
lukepighetticommented, Mar 16, 2022

I also expected this to use

defaults:
  run:
    working-directory: my-rust-project

As the working directory for where cargo run is run

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run cargo command in subdirectories with user-specified ...
I want to create a zsh script that'll run from the rust directory, and for each subdirectory with a Cargo.toml file, run cargo...
Read more >
How do I test a code in a sub-sub-directory? - Stack Overflow
One way would be to create tests/tests.rs with the following contents: mod foo { mod foo; // this will include `tests/foo/foo.rs` }.
Read more >
How to run Cargo in a nested folder - Raul Melo
How to run Cargo in a nested folder. This article was published on Apr ... You're in root level and wants to run...
Read more >
cargo-generate - crates.io: Rust Package Registry
cargo -generate is a developer tool to help you get up and running quickly ... the specific subfolder in the git repository may...
Read more >
Chapter 2. Cargo Red Hat Developer Tools 1
To create a Rust program on the command line, run the cargo tool as follows: ... Cargo.toml and a subdirectory src containing a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found