Skip to content

Commit 59b1132

Browse files
bhperrypavelzw
andauthored
Include bin hash in cache key (#228)
Co-authored-by: Pavel Zwerschke <pavelzw@gmail.com>
1 parent e751044 commit 59b1132

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- uses: actions/checkout@v4
4040
- uses: ./
4141
- run: |
42-
micromamba info | grep -q "environment : None (not found)"
42+
micromamba info | grep -q "environment : base"
4343
shell: bash -el {0}
4444
4545
micromamba-old-version-1:
@@ -170,7 +170,7 @@ jobs:
170170
condarc-file: 'test/.condarc'
171171
- run: | # this should only work when the pytorch channel is loaded, i.e., the custom condarc is used
172172
micromamba search pytorch=2.0.0
173-
micromamba search pytorch=2.0.0 | grep -q "pytorch 2.0.0 py3.10_cpu_0"
173+
micromamba search pytorch=2.0.0 | grep -q "pytorch 2.0.0 py3.10_cpu_0"
174174
shell: bash -el {0}
175175
176176
conda-lock:

dist/main.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-micromamba",
3-
"version": "1.9.0",
3+
"version": "1.10.0",
44
"private": true,
55
"description": "Action to setup micromamba",
66
"scripts": {

src/cache.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const generateEnvironmentKey = (options: Options, prefix: string) => {
4040
const envName = options.environmentName ? `-${options.environmentName}` : ''
4141
const createArgs = options.createArgs ? `-args-${sha256Short(JSON.stringify(options.createArgs))}` : ''
4242
const rootPrefix = `-root-${sha256Short(options.micromambaRootPath)}`
43-
const key = `${prefix}${arch}${envName}${createArgs}${rootPrefix}`
43+
const binHash = fs.readFile(options.micromambaBinPath).then(sha256)
44+
45+
const key = `${prefix}${arch}${envName}${createArgs}${rootPrefix}-bin-${binHash}`
4446

4547
if (options.environmentFile) {
4648
return fs.readFile(options.environmentFile, 'utf-8').then((content) => {

0 commit comments

Comments
 (0)