Skip to content

Update main.yml

Update main.yml #5

Workflow file for this run

on:
push:
branches:
- master
pull_request:
env:
MIX_ENV: test
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
env:
ELIXIR_VERSION: "1.15"
OTP_VERSION: "26.1"
steps:
- name: Check out this repository
uses: actions/checkout@v4
- name: Install Erlang and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION}}
- name: Cache Mix compiled stuff
uses: actions/cache@v3
id: cache-mix
with:
path: |
_build
deps
key: |
mix-elixir${{ env.ELIXIR_VERSION }}-otp${{ env.OTP_VERSION }}-${{ hashFiles('mix.lock') }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
mix-elixir${{ env.ELIXIR_VERSION }}-otp${{ env.OTP_VERSION }}-${{ hashFiles('mix.lock') }}-${{ github.run_id }}-
mix-elixir${{ env.ELIXIR_VERSION }}-otp${{ env.OTP_VERSION }}-${{ hashFiles('mix.lock') }}-
- name: Install dependencies
run: mix deps.get
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
- name: Check for formatted code
run: mix format --check-formatted
dialyzer:
name: Dialyze
runs-on: ubuntu-20.04
env:
ELIXIR_VERSION: "1.15"
OTP_VERSION: "26.1"
steps:
- name: Check out this repository
uses: actions/checkout@v4
- name: Install Erlang and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION}}
- name: Cache Mix compiled stuff
uses: actions/cache@v3
id: cache-mix
with:
path: |
_build
deps
key: |
mix-elixir${{ env.ELIXIR_VERSION }}-otp${{ env.OTP_VERSION }}-${{ hashFiles('mix.lock') }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
mix-elixir${{ env.ELIXIR_VERSION }}-otp${{ env.OTP_VERSION }}-${{ hashFiles('mix.lock') }}-${{ github.run_id }}-
mix-elixir${{ env.ELIXIR_VERSION }}-otp${{ env.OTP_VERSION }}-${{ hashFiles('mix.lock') }}-
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old
# ones. Cache key based on Elixir and Erlang version (also useful when running in matrix).
- name: Cache Dialyzer's PLT
uses: actions/cache@v3
id: cache-plt
with:
path: plts
key: |
plt-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-
- name: Install dependencies
run: mix deps.get
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.cache-plt.outputs.cache-hit != 'true'
run: |
mkdir -p plts
mix dialyzer --plt
- name: Run Dialyzer
run: mix dialyzer --format github