2020-10-09 19:33:15 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
format:
|
|
|
|
name: Check Formatting
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Elixir
|
|
|
|
uses: actions/setup-elixir@v1
|
|
|
|
with:
|
|
|
|
otp-version: 22.2
|
|
|
|
elixir-version: 1.10.4
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: mix deps.get
|
|
|
|
|
|
|
|
- name: Run "mix format"
|
|
|
|
run: mix format --check-formatted
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Build and test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
pair:
|
|
|
|
- erlang: 23.1
|
|
|
|
elixir: 1.10.4
|
|
|
|
- erlang: 22.2
|
|
|
|
elixir: 1.10.4
|
|
|
|
- erlang: 21.3
|
|
|
|
elixir: 1.10.4
|
|
|
|
- erlang: 21.3
|
|
|
|
elixir: 1.9.4
|
|
|
|
- erlang: 20.3.1
|
|
|
|
elixir: 1.8.2
|
2020-10-09 20:00:43 +00:00
|
|
|
env:
|
|
|
|
MIX_ENV: test
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-10-09 19:33:15 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Elixir
|
|
|
|
uses: actions/setup-elixir@v1
|
|
|
|
with:
|
|
|
|
otp-version: ${{matrix.pair.erlang}}
|
|
|
|
elixir-version: ${{matrix.pair.elixir}}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
mix local.hex --force
|
|
|
|
mix local.rebar --force
|
|
|
|
mix deps.get
|
|
|
|
|
|
|
|
- name: Run tests
|
2020-10-09 19:53:07 +00:00
|
|
|
run: mix coveralls.github
|
2020-10-09 19:54:01 +00:00
|
|
|
|
|
|
|
- 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
|