Skip to content

Commit 995bc29

Browse files
committed
Simplify Makefile and update CI
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.
1 parent f4db791 commit 995bc29

File tree

2 files changed

+19
-37
lines changed

2 files changed

+19
-37
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,24 @@ on:
55
pull_request:
66
jobs:
77
test:
8-
name: test
8+
name: test ${{matrix.otp}} on ${{matrix.os}}
99
runs-on: ${{matrix.os}}
10+
container:
11+
image: erlang:${{matrix.otp}}
1012
strategy:
1113
fail-fast: false
1214
matrix:
1315
os:
1416
- ubuntu-latest
1517
otp:
16-
- "24.3.3"
17-
- "23.3.4.5"
18-
- "22.3.4.9"
19-
- "21.3.8.17"
18+
- "24.3.4.0"
19+
- "23.3.4.14"
20+
- "22.3.4.26"
21+
- "21.3.8.24"
2022
- "20.3.8.26"
21-
include:
22-
- os: ubuntu-18.04
23-
otp: "19.3.6.13"
24-
- os: ubuntu-18.04
25-
otp: "18.3.4.11"
23+
- "19.3.6.13"
24+
- "18.3.4.11"
2625
steps:
2726
- uses: actions/[email protected]
28-
- run: |
29-
VERSION=${{matrix.otp}}
30-
RELEASE=$(lsb_release -cs)
31-
DIR=$(mktemp -d)
32-
pushd $DIR
33-
FILE=esl-erlang_$VERSION-1~ubuntu~$RELEASE\_amd64.deb
34-
wget https://packages.erlang-solutions.com/erlang/debian/pool/$FILE
35-
sudo dpkg -i $FILE
36-
popd
37-
rm -r $DIR
3827
- run: make test
28+
- run: REBAR=rebar make test

Makefile

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
PREFIX:=../
2-
DEST:=$(PREFIX)$(PROJECT)
1+
REBAR?=rebar3
32

4-
REBAR=./rebar
3+
.PHONY: all edoc test clean
54

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

8-
all:
9-
@$(REBAR) prepare-deps
10-
11-
edoc: all
12-
@$(REBAR) doc
13-
14-
test:
15-
@rm -rf .eunit
16-
@mkdir -p .eunit
9+
test: build
1710
@$(REBAR) eunit
1811

12+
edoc: build
13+
@$(REBAR) edoc
14+
1915
clean:
2016
@$(REBAR) clean
21-
22-
app:
23-
@[ -z "$(PROJECT)" ] && echo "ERROR: required variable PROJECT missing" 1>&2 && exit 1 || true
24-
@$(REBAR) -r create template=mochiwebapp dest=$(DEST) appid=$(PROJECT)

0 commit comments

Comments
 (0)