-
I want to test against multiple rails versions, but it would be nice to benefit of the caching. For instance I use:
But it doesn’t seem possible to passe dynamic reference of a file into
Obviously this would have to exclude some versions like |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Nesting
|
Beta Was this translation helpful? Give feedback.
-
Hi @Simran-B thanks for the reply, it’s much appreciated! Indeed your proposal create properly the expected key: However, I have no clue why but the cache is never hits even if the tests are green and the key generated have exactly same value. Anyway, the encouraged way to cache:
Generate a correct unique key and works!
|
Beta Was this translation helpful? Give feedback.
-
joel:
If it’s the exact same value, then none of the hashed files can have changed… Very peculiar. I wonder why it doesn’t work with the cache action. But good that you found an alternative solution! |
Beta Was this translation helpful? Give feedback.
-
Yes indeed, it might have an edge case over there but I have not time to investigate further. you can have look though: Here I added back the Manual Cache Setup github.comBuild software better, togetherGitHub is where people build software. More than 56 million people use GitHub to discover, fork, and contribute to over 100 million projects. I did a nonsignificant change, pushed again: github.comBuild software better, togetherGitHub is where people build software. More than 56 million people use GitHub to discover, fork, and contribute to over 100 million projects. Same Key in both, but the key still not found.
Thanks anyway. |
Beta Was this translation helpful? Give feedback.
-
Shouldn’t it be |
Beta Was this translation helpful? Give feedback.
Nesting
${{ }}
expressions inside of expressions is not supported. I’m also pretty sure that$GITHUB_WORKSPACE
won’t work here because the value ofkey
isn’t executed in a shell. You can try the following however:key: ${{ runner.os }}-${{ matrix.ruby-version }}-${{ matrix.rails-version }}-test-${{ hashFiles(format('{0}/gemfiles/rails_{1}.gemfile.lock', github.workspace, matrix.rails-version)) }}