Don't cache Elixir build in static_analysis workflow (#1227)

Still [having
issues](https://github.com/firezone/firezone/actions/runs/3759257641)
with the Elixir cache.

Things tried that didn't work:
- Namespacing by branch name. Github does this already.
- Removing the `restore-keys` in order to only restore the cache if it's
a direct hit.

The `static_analysis` workflow runs `mix compile --force
--warnings-as-errors` which doesn't use the build cache, so it's
removed, which fixes the problem.
This commit is contained in:
Jamil
2022-12-22 13:08:04 -06:00
committed by GitHub
parent 5e8407c017
commit 38c41feb67
3 changed files with 29 additions and 19 deletions

View File

@@ -29,15 +29,17 @@ jobs:
with:
otp-version: '25'
elixir-version: '1.14'
- uses: actions/cache@v3.0.11
name: Setup Elixir cache
- uses: actions/cache@v3
name: Elixir Deps Cache
env:
cache-name: cache-elixir-deps
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ github.ref }}-mix-otp-25-${{ hashFiles('**/mix.lock') }}
# XXX: We've purposefully omitted caching the _build directory here because we
# force-recompile in the pre-commit run below in order to catch any compilation warnings.
path: deps
key: ${{ github.workflow }}-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-mix-otp-25-${{ hashFiles('**/mix.lock') }}
${{ github.workflow }}-${{ runner.os }}-${{ env.cache-name }}-
- uses: actions/cache@v3.0.11
name: Setup ruby cache
with:

View File

@@ -36,14 +36,22 @@ jobs:
with:
otp-version: '25'
elixir-version: '1.14'
- uses: actions/cache@v3.0.11
- uses: actions/cache@v3
name: Elixir Deps Cache
env:
cache-name: cache-elixir-deps
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ github.ref }}-mix-otp-25-${{ hashFiles('**/mix.lock') }}
path: deps
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-mix-otp-25-${{ hashFiles('**/mix.lock') }}
${{ runner.os }}-${{ env.cache-name }}-
- uses: actions/cache@v3
name: Elixir Build Cache
env:
cache-name: cache-elixir-build
with:
path: _build
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
- name: Install Dependencies
run: mix deps.get --only $MIX_ENV
- name: Setup Database