Skip to content

Commit

Permalink
Improve CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmag committed Mar 27, 2021
1 parent 97867c5 commit bcec987
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/ci.yml
@@ -1,54 +1,60 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:

jobs:
format:
name: Code formatting
runs-on: ubuntu-latest
name: Code linting
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Install OTP and Elixir
uses: actions/setup-elixir@v1
- name: Set up Elixir environment
uses: erlef/setup-elixir@v1
with:
otp-version: 20.3
elixir-version: 1.7
otp-version: 23
elixir-version: 1.11

- name: Check format
- name: Check unused dependencies
run: mix deps.get && mix deps.unlock --check-unused

- name: Check formatting
run: mix format --check-formatted

- name: Check compilation warnings
run: mix compile --warnings-as-errors

test:
name: Test suite
runs-on: ubuntu-latest
runs-on: ubuntu-16.04

strategy:
matrix:
pair:
- erlang: 18.3
versions:
- otp: 18.3
elixir: 1.4
- erlang: 19.3
elixir: 1.5
- erlang: 20.3
elixir: 1.6
- erlang: 21.0
elixir: 1.7
- otp: 23
elixir: 1.11

env:
MIX_ENV: test

steps:
- uses: actions/checkout@v2

- name: Install OTP and Elixir
uses: actions/setup-elixir@v1
- name: Set up Elixir environment
uses: erlef/setup-elixir@v1
with:
otp-version: ${{ matrix.pair.erlang }}
elixir-version: ${{ matrix.pair.elixir }}
elixir-version: ${{ matrix.versions.elixir }}
otp-version: ${{ matrix.versions.otp }}

- name: Install dependencies
run: mix deps.get
run: mix deps.get --only test

- name: Run tests
run: mix test

0 comments on commit bcec987

Please sign in to comment.