Skip to content

Commit

Permalink
Simplify Makefile and update CI
Browse files Browse the repository at this point in the history
Remove `app` file and allow specifying a different REBAR executable
so we can test both rebar2 and rebar3.

Since OTP team provides docker images we can use those for CI. They seem to be
a bit more recent than ESL packages and also provide `rebar` and `rebar3`
commands.
  • Loading branch information
nickva committed May 9, 2022
1 parent f4db791 commit 2a6ccc3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 37 deletions.
30 changes: 10 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,24 @@ on:
pull_request:
jobs:
test:
name: test
name: test ${{matrix.otp_vsn}} on ${{matrix.os}}
runs-on: ${{matrix.os}}
container:
image: erlang:${{matrix.otp_vsn}}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
otp:
- "24.3.3"
- "23.3.4.5"
- "22.3.4.9"
- "21.3.8.17"
- "24.3.4.0"
- "23.3.4.14"
- "22.3.4.26"
- "21.3.8.24"
- "20.3.8.26"
include:
- os: ubuntu-18.04
otp: "19.3.6.13"
- os: ubuntu-18.04
otp: "18.3.4.11"
- "19.3.6.13"
- "18.3.4.11"
steps:
- uses: actions/[email protected]
- run: |
VERSION=${{matrix.otp}}
RELEASE=$(lsb_release -cs)
DIR=$(mktemp -d)
pushd $DIR
FILE=esl-erlang_$VERSION-1~ubuntu~$RELEASE\_amd64.deb
wget https://packages.erlang-solutions.com/erlang/debian/pool/$FILE
sudo dpkg -i $FILE
popd
rm -r $DIR
- run: make test
- run: REBAR=rebar make test
26 changes: 9 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
PREFIX:=../
DEST:=$(PREFIX)$(PROJECT)
REBAR?=rebar3

REBAR=./rebar
.PHONY: all edoc test clean

.PHONY: all edoc test clean build_plt dialyzer app
build:
@$(REBAR) get-deps # rebar2 compatibility, it's no-op on rebar3
@$(REBAR) compile

all:
@$(REBAR) prepare-deps

edoc: all
@$(REBAR) doc

test:
@rm -rf .eunit
@mkdir -p .eunit
test: build
@$(REBAR) eunit

edoc: build
@$(REBAR) edoc

clean:
@$(REBAR) clean

app:
@[ -z "$(PROJECT)" ] && echo "ERROR: required variable PROJECT missing" 1>&2 && exit 1 || true
@$(REBAR) -r create template=mochiwebapp dest=$(DEST) appid=$(PROJECT)

0 comments on commit 2a6ccc3

Please sign in to comment.