Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workspaces input field to support non-root projects #32

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

gruebel
Copy link
Contributor

@gruebel gruebel commented Jan 12, 2024

Thanks for the great action 🏆 we use it in one of our projects and it raises an error with the default configuration, because of caching being enabled. This happens, if your main Cargo.toml is in a sub-folder and this can be easily mitigated by leveraging the workspaces field in the Swatinem/rust-cache action.

Error

Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
    at ExecState._setResult (/home/runner/work/_actions/Swatinem/rust-cache/v2/dist/restore/index.js:7784:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/Swatinem/rust-cache/v2/dist/restore/index.js:7767:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/Swatinem/rust-cache/v2/dist/restore/index.js:7661:27)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  commandFailed: {
    command: 'cargo metadata --all-features --format-version 1 --no-deps',
    stderr: '\x1B[1m\x1B[31merror\x1B[0m\x1B[1m:\x1B[0m could not find `Cargo.toml` in `/home/runner/work/xyz/xyz` or any parent directory\n'
  }
}

Copy link
Contributor

@robjtede robjtede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks 👍🏻

@robjtede robjtede merged commit 84e65ce into actions-rust-lang:main Jan 13, 2024
31 checks passed
@gruebel gruebel deleted the add-workspaces branch January 13, 2024 19:03
@gruebel gruebel restored the add-workspaces branch January 13, 2024 19:03
@jonasbb
Copy link
Member

jonasbb commented Jan 13, 2024

Thank you for the PR. Adding some support for projects where the Rust code is not in the project root is nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants