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

Include bin hash in cache key #228

Merged
merged 5 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./
- run: |
micromamba info | grep -q "environment : None (not found)"
micromamba info | grep -q "environment : base"
shell: bash -el {0}

micromamba-old-version-1:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
condarc-file: 'test/.condarc'
- run: | # this should only work when the pytorch channel is loaded, i.e., the custom condarc is used
micromamba search pytorch=2.0.0
micromamba search pytorch=2.0.0 | grep -q "pytorch 2.0.0 py3.10_cpu_0"
micromamba search pytorch=2.0.0 | grep -q "pytorch 2.0.0 py3.10_cpu_0"
shell: bash -el {0}

conda-lock:
Expand Down
3 changes: 2 additions & 1 deletion dist/main.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-micromamba",
"version": "1.9.0",
"version": "1.10.0",
"private": true,
"description": "Action to setup micromamba",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const generateEnvironmentKey = (options: Options, prefix: string) => {
const envName = options.environmentName ? `-${options.environmentName}` : ''
const createArgs = options.createArgs ? `-args-${sha256Short(JSON.stringify(options.createArgs))}` : ''
const rootPrefix = `-root-${sha256Short(options.micromambaRootPath)}`
const key = `${prefix}${arch}${envName}${createArgs}${rootPrefix}`
const binHash = fs.readFile(options.micromambaBinPath).then(sha256)

const key = `${prefix}${arch}${envName}${createArgs}${rootPrefix}-bin-${binHash}`

if (options.environmentFile) {
return fs.readFile(options.environmentFile, 'utf-8').then((content) => {
Expand Down
Loading