This repository has been archived by the owner on Dec 29, 2024. It is now read-only.
build(deps): update dependency dialyxir to == 1.4.5 #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
pull_request: | |
workflow_call: | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
# ignore the push event trigger if a PR is open for the current branch | |
prevent_duplicate_checks: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
steps: | |
# note: probably don't use that action it has a few known bugs I probably will never fix. | |
# Instead take a look at: https://github.com/fkirc/skip-duplicate-actions | |
- uses: insurgent-lab/is-in-pr-action@129df59687402c4a9c81a9a9e88d7448cdbba541 # v0.2.0 | |
id: isInPR | |
outputs: | |
should-run: ${{ !(steps.isInPR.outputs.result == 'true' && github.event_name == 'push') }} | |
test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
needs: prevent_duplicate_checks | |
if: ${{ needs.prevent_duplicate_checks.outputs.should-run == 'true' }} | |
env: | |
MIX_ENV: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up BEAM | |
id: setup-beam | |
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2 | |
with: | |
version-type: strict | |
version-file: .tool-versions | |
- name: Restore dependencies cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
env: | |
cache-key: deps | |
with: | |
key: ${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} | |
restore-keys: | | |
${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}- | |
${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}- | |
path: | | |
deps | |
_build | |
- name: Install dependencies | |
run: | | |
mix local.hex --force | |
mix do deps.get, deps.compile | |
- name: Check formatting | |
run: mix format --check-formatted | |
- name: Compile code (without warning) | |
run: mix compile --warnings-as-errors | |
- name: Run tests | |
run: mix test | |
# Dialyzer | |
- name: Restore PLTs cache | |
id: restore_plts_cache | |
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
env: | |
cache-key: plts | |
with: | |
key: ${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} | |
restore-keys: | | |
${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}- | |
${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}- | |
path: priv/plts | |
- name: Create PLTs | |
if: steps.restore_plts_cache.outputs.cache-hit != 'true' | |
env: | |
MIX_ENV: dev | |
run: | | |
mkdir -p priv/plts/core.plt | |
mix dialyzer --plt | |
- name: Save PLTs cache | |
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
env: | |
cache-key: plts | |
if: steps.restore_plts_cache.outputs.cache-hit != 'true' | |
with: | |
key: ${{ env.cache-key }}-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} | |
path: priv/plts | |
- name: Run dialyzer | |
env: | |
MIX_ENV: dev | |
run: mix dialyzer --format github | |