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

Setting doNotCacheOnWorkflowFailure: true disables caching entirely (?) #125

Closed
equeim opened this issue Jan 29, 2022 · 5 comments
Closed

Comments

@equeim
Copy link

equeim commented Jan 29, 2022

I use run-vcpkg action from my own compisite action like this: https://github.com/equeim/action-setup-vcpkg-msvc/blob/master/action.yml

There I set doNotCacheOnWorkflowFailure input to true. Then, when job is completed successfully, post action from run-vcpkg says that:

Save vcpkg and its artifacts into GitHub service cache
  Caching is disabled, saving cache is skipped.

AFAIK, it can happen only if doNotCache input is true and it false by default.

There is log when run-vcpkg is invoked:

Run lukka/run-vcpkg@v10
  with:
    vcpkgGitCommitId: dd42206f86a7b9f7747ccb63fa0e36baaab5fa1e
    appendedCacheKey: d817028e1760c31609f9e53637b20f8ddde03229611a26d440364f0eceb7219e
    doNotCacheOnWorkflowFailure: true
    vcpkgDirectory: D:\a\libtremotesf\libtremotesf/vcpkg
    runVcpkgInstall: false
    vcpkgGitURL: https://github.com/microsoft/vcpkg.git
    doNotUpdateVcpkg: false
    doNotCache: false
    vcpkgJsonGlob: **/vcpkg.json
    vcpkgJsonIgnores: ['**/vcpkg/**']
    runVcpkgFormatString: [`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`]
    useShell: true
    logCollectionRegExps: \s*"(.+CMakeOutput\.log)"\.\s*;\s*"(.+CMakeError\.log)"\.\s*;\s*(.+out\.log)\s*;\s+(.+err\.log)\s*;\s*(.+vcpkg.+\.log)\s*
    jobStatus: success

Could it be related to the fact that I use it from composite action?

@lukka
Copy link
Owner

lukka commented Jan 30, 2022

@equeim By inspecting the code the message you mentioned is only outputted when doNotCache is false. The value of doNotCacheOnWorkflowFailure should not be important. We could validate all those assertions by looking into the complete log with verbose output.

Could you confirm whether this looks correct?

@equeim
Copy link
Author

equeim commented Jan 30, 2022

Hmm. I took another look at the action code, and it looks like that constructor arguments for VcpkgPostAction class are in the wrong order:

jobSucceeded, doNotCache, doNotCacheOnWorkflowFailure,

and
private doNotCacheOnWorkflowFailure: boolean,

(doNotCacheOnWorkflowFailure and doNotCache are mixed up).

@lukka lukka mentioned this issue Jan 30, 2022
@lukka
Copy link
Owner

lukka commented Jan 30, 2022

Fixed in #126 , please try run-vcpkg@v10.1 and let me know!

@lukka lukka closed this as completed Jan 30, 2022
@equeim
Copy link
Author

equeim commented Jan 31, 2022

It seems that doNotCacheOnWorkflowFailure is removed in 10.1. Does this mean that there is now no way to disable cache saving when workflow fails?

@lukka
Copy link
Owner

lukka commented Jan 31, 2022

@equeim right, it was removed because the detection of the job status in the post action never worked.
Please refer to #115 for a similar discussion.

The way it works now is as follows:

  • run-vcpkg succeeded
    • if cache-hit then skip saving cache
    • if cache-miss, then save cache (and if the cache was partially created, it will be saved anyway).
  • run-vcpkg failed or did not execute
    • no cache saved

Opened #128 about solving this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants