Skip to content

Instantly share code, notes, and snippets.

@dkarter
Created May 11, 2020 22:02
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save dkarter/a69f06f0ad2ea5877f5dba4f3ba8145f to your computer and use it in GitHub Desktop.
Save dkarter/a69f06f0ad2ea5877f5dba4f3ba8145f 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