diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aa9b207 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + - push + - pull_request + +permissions: + contents: read + +jobs: + build: + name: OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }} + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - elixir: 1.12.0 + otp: 22.3 + - elixir: 1.15.2 + otp: 25.3 + env: + MIX_ENV: test + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: ${{ matrix.otp }} + elixir-version: ${{ matrix.elixir }} + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + restore-keys: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}- + - name: Restore build cache + uses: actions/cache@v3 + with: + path: _build/test + key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + restore-keys: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}- + - name: Install dependencies + run: mix deps.get + - name: Compile dependencies + run: mix deps.compile + - name: Compile + run: mix compile --warnings-as-errors + - name: Dialyzer + run: mix dialyzer --halt-exit-status + - name: Run tests + run: mix coveralls.github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cd0517a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: elixir -sudo: false -elixir: - - 1.6 - - 1.7 - - 1.8 - - 1.9 -otp_release: - - 19.3 - - 20.3 - - 21.0 - - 22.0 -matrix: - exclude: - - elixir: 1.6 - otp_release: 21.0 - - elixir: 1.6 - otp_release: 22.0 - - elixir: 1.7 - otp_release: 19.3 - - elixir: 1.7 - otp_release: 20.3 - - elixir: 1.8 - otp_release: 19.3 - - elixir: 1.8 - otp_release: 20.3 - - elixir: 1.9 - otp_release: 19.3 - - elixir: 1.9 - otp_release: 20.3 - include: - - elixir: 1.9 - otp_release: 22.0 - env: DIALZYER_TASK=", dialyzer --halt-exit-status" -env: - global: - - MIX_ENV=test -before_install: - - git submodule update --init --recursive -script: - - "mix do deps.get, deps.compile, compile --warnings-as-errors $DIALZYER_TASK && mix coveralls.travis" -notifications: - email: - - jonas.schmidt@gmx.com diff --git a/README.md b/README.md index 491cfba..bc14717 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Elixir JSON Schema Validator -[![Build Status](https://app.travis-ci.com/jonasschmidt/ex_json_schema.svg?branch=master)](https://app.travis-ci.com/github/jonasschmidt/ex_json_schema) +[![Build Status](https://github.com/jonasschmidt/ex_json_schema/actions/workflows/ci/badge.svg?branch=master)](https://github.com/jonasschmidt/ex_json_schema/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/jonasschmidt/ex_json_schema/badge.svg?branch=master)](https://coveralls.io/github/jonasschmidt/ex_json_schema?branch=master) [![Module Version](https://img.shields.io/hexpm/v/ex_json_schema.svg)](https://hex.pm/packages/ex_json_schema) [![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ex_json_schema/) diff --git a/mix.exs b/mix.exs index 5be2e06..03fe51f 100644 --- a/mix.exs +++ b/mix.exs @@ -21,7 +21,7 @@ defmodule ExJsonSchema.Mixfile do preferred_cli_env: [coveralls: :test, dialyzer: :test], dialyzer: [ plt_add_apps: [:ex_unit], - plt_core_path: ".", + plt_core_path: "_build/#{Mix.env()}", plt_add_deps: :transitive ] ]