Skip to content

Possible typo? #43

@rschenk

Description

@rschenk

- name: Get Hex cache
uses: actions/cache@v2
id: hex-cache
with:
path: ~/.hex
key: build-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
build-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-

We've been using this setup in our CI for the past few months with great results, but last week I needed to manually expire the hex cache and got massively confused by this cache key.

Is this a typo? Should the prefix be hex-? And shouldn't it include the inputs.cache-key so it can be expired with the rest?

As it is now, both the _build/ and .hex caches use the build- prefix for the cache key, the only difference between them being the presence of inputs.cache-key. This makes it hard to differentiate the caches in the github actions ui and impossible to manually expire the hex cache (by changing the value of inputs.cache-key that is).

Would it be better to update the hex key to something like

key: hex-${{ inputs.cache-key }}-${{ runner.os }}-${{ inputs.otp-version }}-${{ inputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions