rdf-ex/.github/workflows/ci.yml
2022-06-27 22:20:53 +08:00

84 lines
2.2 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-18.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- pair:
elixir: 1.10.4
otp: 21.3
no-warnings-as-errors: true
- pair:
elixir: 1.11.3
otp: 22.2
no-warnings-as-errors: true
- pair:
elixir: 1.12.3
otp: 24.3.4
# Although Elixir 1.12 supports this feature, we're expecting errors since the code to suppress
# undefined-function-warnings on RDF.Graph.build blocks relies on Elixir 1.13 and is disabled
# partially on older versions.
no-warnings-as-errors: true
- pair:
elixir: 1.13.4
otp: 23.3
- pair:
elixir: 1.13.4
otp: 24.3
- pair:
elixir: 1.13.4
otp: 25.0
lint: lint
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- name: Install Dependencies
run: mix deps.get
- run: mix format --check-formatted
if: ${{ matrix.lint }}
- run: mix deps.get && mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- run: mix deps.compile
- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- run: MIX_ENV=test mix coveralls.github --warnings-as-errors
if: ${{ !matrix.no-warnings-as-errors }}
- run: MIX_ENV=test mix coveralls.github
if: ${{ matrix.no-warnings-as-errors }}
- name: Retrieve PLT Cache
uses: actions/cache@v1
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ 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