Skip to content

Commit

Permalink
Add anyhow dep to test project so we can see more action in the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Jan 20, 2025
1 parent 7717ef7 commit 6cff991
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ runs:
run: |
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
if: inputs.use-sccache == 'true' && steps.rust-cache.outputs.cache-hit == 'true'
if: inputs.use-sccache == 'true' && steps.rust-cache.outputs.cache-hit == 'true' && steps.determine-cross-compile.outputs.needs-cross != 'true'

- name: Run tests (*nix)
working-directory: ${{ inputs.working-directory }}
Expand Down
11 changes: 10 additions & 1 deletion test-project/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test-project/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "test-project"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.95"

# For testing it would be nice to create a binary with spaces in the name, but
# right now the `name` value must be a valid crate name, and there's no
# separate setting for the compiled executable's name. See
Expand Down
10 changes: 10 additions & 0 deletions test-project/src/bin1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
use anyhow::Result;

fn main() {
println!("Hello, world!");
if let Err(e) = run_something() {
eprintln!("{e}");
std::process::exit(1);
}
}

fn run_something() -> Result<()> {
Ok(())
}

#[cfg(test)]
Expand Down

0 comments on commit 6cff991

Please sign in to comment.