Skip to content

Fix compatibility with OTP 26 #95

Fix compatibility with OTP 26

Fix compatibility with OTP 26 #95

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: 'Shards Test on OTP ${{ matrix.otp }} and ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- otp: '26.x'
os: 'ubuntu-latest'
coverage: true
xref: true
dialyzer: true
- otp: '25.x'
os: 'ubuntu-latest'
- otp: '24.x'
os: 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTP_VERSION: ${{ matrix.otp }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: Cache deps
uses: actions/cache@v3
with:
path: |
_build
key: |
${{ runner.os }}-${{ matrix.otp }}-build-${{ hashFiles(format('rebar.lock')) }}
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-build-
- name: Compile
run: make compile
- name: Tests
run: |
make test
if: ${{ !matrix.coverage }}
- name: Tests with coverage
run: |
make test
make covertool
if: ${{ matrix.coverage }}
- name: Xref
run: make xref
if: ${{ matrix.xref }}
- name: Restore PLT Cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-plt-v1
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-plt-v1
if: ${{ matrix.dialyzer }}
- name: Dialyzer
run: make dialyzer
if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: _build/test/covertool/shards.covertool.xml
flags: otp-${{ matrix.otp }}
fail_ci_if_error: true
if: ${{ matrix.coverage }}