Skip to content

Handle Dialyzer warnings (#81) #247

Handle Dialyzer warnings (#81)

Handle Dialyzer warnings (#81) #247

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
jobs:
fmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
sudo apt update
sudo apt install emacs-nox
- name: Run erlang-formatter
run: |
rebar3 fmt
status="$(git status --untracked-file=no --porcelain)"
if [ ! -z "$status" ]; \
then \
echo "Error: Please format the following files (e.g. run 'rebar3 fmt')"; \
echo "$status"; \
exit 1; \
fi
ci:
strategy:
matrix:
include: # See https://www.erlang-solutions.com/downloads/
- otp-version: 25.0.3
platform: ubuntu-20.04
lsb_release: focal
- otp-version: 24.3.3
platform: ubuntu-20.04
lsb_release: focal
- otp-version: 23.3.4.5
platform: ubuntu-20.04
lsb_release: focal
- otp-version: 22.3.4.9
platform: ubuntu-20.04
lsb_release: focal
- otp-version: 21.3.8.17
platform: ubuntu-20.04
lsb_release: focal
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Hex packages
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-${{ matrix.otp-version }}-hex-${{ hashFiles('**/rebar.lock') }}
- name: Cache Dialyzer PLTs
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/rebar3_*_plt
key: ${{ runner.os }}-${{ matrix.otp-version }}-dialyzer-${{ hashFiles('**/rebar.config') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp-version }}-dialyzer-
- name: Install Erlang/OTP
run: |
DEB_NAME="esl-erlang_${{ matrix.otp-version }}-1~ubuntu~${{ matrix.lsb_release }}_amd64.deb"
curl -f https://packages.erlang-solutions.com/erlang/debian/pool/$DEB_NAME -o $DEB_NAME
sudo dpkg --install $DEB_NAME
- name: Install compatible rebar3 version
if: ${{ startsWith(matrix.otp-version, '20.') || startsWith(matrix.otp-version, '21.') || startsWith(matrix.otp-version, '22.') || startsWith(matrix.otp-version, '23.') || startsWith(matrix.otp-version, '24.')}}
run: |
git clone https://github.com/erlang/rebar3.git
cd rebar3 && git checkout 3.15.2 && ./bootstrap && ./rebar3 local install
echo "$HOME/.cache/rebar3/bin" >> $GITHUB_PATH
- name: Install elvis
run: |
git clone --depth 1 --branch 1.1.0 https://github.com/inaka/elvis.git
cd elvis && rebar3 escriptize && sudo cp _build/default/bin/elvis /usr/local/bin/
- name: Install faketime
run: |
sudo apt update
sudo apt install -yy --no-install-recommends faketime
- name: Build and test
run: |
make compile
make ut ct-tcp
make cover
- name: Run checks
run: |
make elvis
make xref
make dialyzer
- name: Generate docs
run: |
make edoc
git diff --exit-code ./doc || echo "** Please commit your changes from 'make edoc' **"