fix: use loadpaths instead of run (#108) #229
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: CI | |
on: | |
pull_request: | |
push: | |
branches: main | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Test (${{matrix.elixir}}/${{matrix.otp}}) | |
strategy: | |
matrix: | |
otp: [24.x, 25.x, 26.x] | |
elixir: [1.13.x, 1.14.x, 1.15.x] | |
exclude: | |
- otp: 26.x | |
elixir: 1.13.x | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-mix-${{matrix.otp}}-${{matrix.elixir}}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix-${{matrix.otp}}-${{matrix.elixir}}- | |
- name: Install Dependencies | |
run: mix deps.get | |
- name: Start EPMD | |
run: epmd -daemon | |
- name: Compile | |
env: | |
MIX_ENV: test | |
run: mix compile | |
- name: remove tmp dir | |
run: rm -rf tmp | |
- name: Run Tests | |
run: mix test | |
formatter: | |
runs-on: ubuntu-latest | |
name: Formatter (1.15.x/26.x) | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
id: beam | |
with: | |
otp-version: 26.x | |
elixir-version: 1.15.x | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-mix-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}- | |
- name: Install Dependencies | |
run: mix deps.get | |
- name: Run Formatter | |
run: mix format --check-formatted | |
dialyzer: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 26.x | |
elixir-version: 1.15.x | |
# 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/restore@v3 | |
id: plt_cache | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
path: | | |
priv/plts | |
- name: Install Dependencies | |
run: mix deps.get | |
# Create PLTs if no cache was found | |
- name: Create PLTs | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
run: mix dialyzer --plt | |
# By default, the GitHub Cache action will only save the cache if all steps in the job succeed, | |
# so we separate the cache restore and save steps in case running dialyzer fails. | |
- name: Save PLT cache | |
uses: actions/cache/save@v3 | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
id: plt_cache_save | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
path: | | |
priv/plts | |
- name: Run dialyzer | |
run: mix dialyzer --format github |