Move from Travis CI to GitHub Actions

This commit is contained in:
Marcel Otto 2020-10-13 16:44:29 +02:00
commit 2fed031db1
3 changed files with 80 additions and 29 deletions

79
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,79 @@
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
run: MIX_ENV=test mix coveralls.github
- name: Retrieve PLT Cache
uses: actions/cache@v1
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.pair.erlang }}-${{ matrix.pair.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

View file

@ -1,28 +0,0 @@
language: elixir
matrix:
include:
# TODO: temporarily disabled since the newest version of Hackney (used by excoveralls) doesn't seem to work with OTP 20 ("Compiling src/hackney_ssl.erl failed")
# - otp_release: 20.0
# elixir: 1.8
- otp_release: 21.0
elixir: 1.8
- otp_release: 22.0
elixir: 1.8
# TODO: temporarily disabled since the newest version of Hackney (used by excoveralls) doesn't seem to work with OTP 20 ("Compiling src/hackney_ssl.erl failed")
# - otp_release: 20.0
# elixir: 1.9
- otp_release: 22.0
elixir: 1.9
- otp_release: 21.0
elixir: 1.10
- otp_release: 22.0
elixir: 1.10
- otp_release: 23.0
elixir: 1.10
sudo: false
script:
- MIX_ENV=test mix coveralls.travis
- mix dialyzer
cache:
directories:
- priv/plts

View file

@ -2,7 +2,7 @@
# JSON-LD.ex
[![Travis](https://img.shields.io/travis/rdf-elixir/jsonld-ex.svg?style=flat-square)](https://travis-ci.org/rdf-elixir/jsonld-ex)
[![CI](https://github.com/rdf-elixir/jsonld-ex/workflows/CI/badge.svg?branch=master)](https://github.com/rdf-elixir/jsonld-ex/actions?query=branch%3Amaster+workflow%3ACI)
[![Hex.pm](https://img.shields.io/hexpm/v/json_ld.svg?style=flat-square)](https://hex.pm/packages/json_ld)
[![Coverage Status](https://coveralls.io/repos/github/rdf-elixir/jsonld-ex/badge.svg?branch=master)](https://coveralls.io/github/rdf-elixir/jsonld-ex?branch=master)