diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index d6e2a784f..48c8a2eec 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -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: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d4a8cb3c..4e877d8a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd4292165..0da2f9dc6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,12 @@ repos: - repo: local hooks: # Elixir config + - id: mix-compile + name: 'elixir: mix compile' + entry: mix compile --force --warnings-as-errors + language: system + pass_filenames: false + files: \.ex$ - id: mix-format name: 'elixir: mix format' entry: mix format --check-formatted @@ -18,12 +24,6 @@ repos: language: system pass_filenames: false files: \.exs*$ - - id: mix-compile - name: 'elixir: mix compile' - entry: mix compile --force --warnings-as-errors - language: system - pass_filenames: false - files: \.ex$ - id: codespell name: 'python: codespell' entry: codespell