-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ccache-action respect environment variables (#217)
Currently, if environment variables are set for CCACHE_DIR or SCCACHE_DIR then this action will ignore them and hardcode its own. This is a problem if CCACHE_DIR is set for example in a docker file environment which is very hard to eliminate Fixes #96
- Loading branch information
1 parent
ed97999
commit 6f08740
Showing
6 changed files
with
89 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import path from "path"; | ||
|
||
export function cacheDir(ccacheVariant: string): string { | ||
const ghWorkSpace = process.env.GITHUB_WORKSPACE || "unreachable, make ncc happy"; | ||
if (ccacheVariant === "ccache") { | ||
return process.env.CCACHE_DIR || path.join(ghWorkSpace, ".ccache"); | ||
} else if (ccacheVariant === "sccache") { | ||
return process.env.SCCACHE_DIR || path.join(ghWorkSpace, ".sccache"); | ||
} | ||
throw Error("Unknown ccache variant: " + ccacheVariant); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters