diff --git a/analyze-project/README.md b/analyze-project/README.md index 8dca54d..58e55f2 100644 --- a/analyze-project/README.md +++ b/analyze-project/README.md @@ -52,3 +52,7 @@ For example, project-directory: ${{ github.workspace }}/packages/myproject install-args: "--extras 'colors serialization' --with dev,docs,utils" ``` + +### `use-cache` + +If you run into caching problems, you can disable caching by specifying `use-cache: false`. diff --git a/analyze-project/action.yml b/analyze-project/action.yml index 1319a89..ac4c67e 100644 --- a/analyze-project/action.yml +++ b/analyze-project/action.yml @@ -17,6 +17,11 @@ inputs: default: '' required: false type: string + use-cache: + description: > + A Boolean specifying whether to use the cache. Set this to false to work + around caching problems. + default: true runs: using: composite @@ -56,7 +61,10 @@ runs: env: INSTALL_ARGS: ${{ inputs.install-args }} - name: Cache virtualenv + if: ${{ inputs.use-cache == 'true' }} uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + # Work around https://github.com/actions/cache/issues/1754 - Windows runner randomly dies in actions/cache + continue-on-error: true with: path: ${{ steps.get_project_info.outputs.venv-path }} key: ${{ steps.get_project_info.outputs.name }}-${{ runner.os }}-py${{ env.pythonVersion }}-${{ hashFiles(format('{0}/poetry.lock', inputs.project-directory)) }}-${{ steps.install_args_hash.outputs.hash }} diff --git a/setup-poetry/action.yml b/setup-poetry/action.yml index c64bdcf..5a93e02 100644 --- a/setup-poetry/action.yml +++ b/setup-poetry/action.yml @@ -53,6 +53,8 @@ runs: if: ${{ inputs.use-cache == 'true' }} id: cache-poetry uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + # Work around https://github.com/actions/cache/issues/1754 - Windows runner randomly dies in actions/cache + continue-on-error: true with: # Using ${{ env.POETRY_HOME }} here does not work because it is evaluated before the "set paths" step runs. path: |