Skip to content

Instantly share code, notes, and snippets.

@Rovel
Forked from dkarter/elixir.yml
Created June 1, 2020 01:46
Show Gist options
  • Save Rovel/2123c0585840b270319d89de40d2f5ee to your computer and use it in GitHub Desktop.
Save Rovel/2123c0585840b270319d89de40d2f5ee to your computer and use it in GitHub Desktop.
name: Elixir CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
MIX_ENV: test
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.10.2]
otp: [22.2.8]
steps:
- uses: actions/checkout@v2
- name: Setup elixir
uses: actions/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }} # Define the elixir version [required]
otp-version: ${{ matrix.otp }} # Define the OTP version [required]
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v1
id: mix-cache #id to use in retrieve action
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Run Tests
run: mix test
- name: Retrieve PLT Cache
uses: actions/cache@v1
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --no-check --halt-exit-status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment