This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
chore: add credo, dialyzer and basic GitHub Actions CI checks [Fixes #27] #6
Workflow file for this run
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: Elixir Type Linting | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
# Cancel any in-progress instances of this workflow when this instance is triggered. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Run Dialyzer | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend-elixir | |
env: | |
MIX_ENV: dev | |
strategy: | |
matrix: | |
otp: ["26.0.2"] | |
elixir: ["1.15.5"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Elixir Project | |
uses: ./.github/actions/elixir-setup | |
id: beam | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
working-directory: backend-elixir | |
build-app: false | |
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones | |
# Cache key based on Elixir & Erlang version (also useful when running in matrix) | |
- name: Restore PLT cache | |
uses: actions/cache@v3 | |
id: plt_cache | |
with: | |
key: plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('**/*.ex') }} | |
restore-keys: | | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('**/*.ex') }} | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}- | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}- | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}- | |
path: priv/plts | |
# Create PLTs if no cache was found. | |
# Always rebuild PLT when a job is retried | |
# (If they were cached at all, they'll be updated when we run mix dialyzer with no flags.) | |
- name: Create PLTs | |
if: steps.plt_cache.outputs.cache-hit != 'true' || github.run_attempt != '1' | |
run: mix dialyzer --plt | |
- name: Run Dialyzer | |
run: mix dialyzer --format github |