Skip to content

Commit

Permalink
Set GOLANGCI_LINT_CACHE env var to temp dir
Browse files Browse the repository at this point in the history
Without this golangci-lint will try to use /.cache as its cache dir in Docker
containers, which it may not have access to. This causes tests for other archs
run by `cross` to fail, since those run in Docker containers.
  • Loading branch information
autarch committed Mar 20, 2023
1 parent 0f67bdf commit 47c6693
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/ubi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ pub fn run_command(cmd: &Path, args: &[&str]) -> Result<(Option<String>, Option<
"GITHUB_TOKEN",
env::var("GITHUB_TOKEN").as_deref().unwrap_or(""),
);
// Without this golangci-lint will try to use /.cache as its cache dir in
// Docker containers, which it may not have access to.
c.env("GOLANGCI_LINT_CACHE", env::temp_dir());

output_from_command(c, cmd, args)
}
Expand Down

0 comments on commit 47c6693

Please sign in to comment.