Skip to content

Commit 305c597

Browse files
committed
Add support to send C coverage. Don't cache. Move hex plugin to Action
1 parent 21a7627 commit 305c597

File tree

5 files changed

+71
-18
lines changed

5 files changed

+71
-18
lines changed

.github/workflows/ci.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,35 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
otp: ['19.3', '22.3', 24]
12+
otp: ['19.3', '21.3', 24]
1313
runs-on: ubuntu-20.04
1414
container:
1515
image: erlang:${{ matrix.otp }}
16-
1716
steps:
18-
1917
- uses: actions/checkout@v2
20-
21-
- name: Cache rebar3
22-
uses: actions/cache@v2
23-
with:
24-
path: |
25-
~/.cache/rebar3/
26-
key: ${{matrix.otp}}-${{hashFiles('rebar.config')}}
27-
2818
- run: rebar3 compile
2919
- run: rebar3 xref
3020
- run: rebar3 dialyzer
3121
- run: rebar3 eunit -v
3222
- run: REBAR=rebar3 make spec
3323
- run: REBAR=rebar3 make xdata
3424

25+
cover:
26+
name: Cover
27+
needs: [tests]
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- uses: actions/checkout@v2
31+
- run: ./configure --enable-gcov
32+
- run: rebar3 compile
33+
- run: rebar3 eunit -v
34+
- run: pip install --user cpp-coveralls
35+
#- run: cpp-coveralls -b `pwd` --verbose --gcov-options '\-lp' --dump c.json
3536
- name: Send to Coveralls
36-
if: matrix.otp == 24
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
run: |
40+
#ADDJSONFILE=c.json COVERALLS=true rebar3 as test coveralls send
4041
COVERALLS=true rebar3 as test coveralls send
4142
curl -v -k https://coveralls.io/webhook \
4243
--header "Content-Type: application/json" \

.github/workflows/hexpm-release.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: hexpm-release
1+
name: Hex
22

33
on:
44
push:
@@ -12,6 +12,11 @@ jobs:
1212
- name: Check out
1313
uses: actions/checkout@v2
1414

15+
- name: Setup rebar3 hex
16+
run: |
17+
mkdir -p ~/.config/rebar3/
18+
echo "{plugins, [rebar3_hex]}." > ~/.config/rebar3/rebar.config
19+
1520
- name: Publish to hex.pm
1621
run: rebar3 hex publish --repo hexpm --yes || head rebar3.crashdump
1722
env:

configure.ac

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
AC_PREREQ(2.59c)
2+
AC_PACKAGE_VERSION(1.0.0)
3+
AC_PACKAGE_NAME(xmpp)
4+
AC_INIT(xmpp, 1.0.0, [], xmpp)
5+
6+
# Checks for programs.
7+
AC_PROG_CC
8+
AC_PROG_MAKE_SET
9+
10+
if test "x$GCC" = "xyes"; then
11+
CFLAGS="$CFLAGS -Wall"
12+
fi
13+
14+
# Checks for typedefs, structures, and compiler characteristics.
15+
AC_C_CONST
16+
17+
# Checks for library functions.
18+
AC_FUNC_MALLOC
19+
AC_HEADER_STDC
20+
21+
# Checks Erlang runtime and compiler
22+
AC_ERLANG_NEED_ERL
23+
AC_ERLANG_NEED_ERLC
24+
25+
# Checks and sets ERLANG_ROOT_DIR and ERLANG_LIB_DIR variable
26+
# AC_ERLANG_SUBST_ROOT_DIR
27+
# AC_ERLANG_SUBST_LIB_DIR
28+
29+
AC_ARG_ENABLE(gcov,
30+
[AC_HELP_STRING([--enable-gcov], [compile with gcov enabled (default: no)])],
31+
[case "${enableval}" in
32+
yes) gcov=true ;;
33+
no) gcov=false ;;
34+
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gcov) ;;
35+
esac],[gcov=false])
36+
37+
AC_SUBST(gcov)
38+
39+
AC_CONFIG_FILES([vars.config])
40+
41+
AC_OUTPUT

rebar.config.script

+5-5
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ Rules = [
152152
{[port_env, "LDFLAGS"], true,
153153
AppendStr(CfgLDFlags), "$LDFLAGS"},
154154
{[post_hooks], (not IsRebar3) and (CfgWithGCov == "true"),
155-
AppendList([{eunit, "gcov -o c_src stringprep"},
155+
AppendList([{eunit, "gcov -o c_src jid xmpp_lang xmpp_uri"},
156156
{eunit, "mv *.gcov .eunit/"}]), []},
157157
{[post_hooks], IsRebar3 and (CfgWithGCov == "true"),
158-
AppendList([{eunit, "gcov -o c_src stringprep"},
158+
AppendList([{eunit, "gcov -o c_src jid xmpp_lang xmpp_uri"},
159159
{eunit, "mv *.gcov _build/test/cover/"}]), []},
160160
{[port_env, "LDFLAGS"], CfgWithGCov == "true",
161161
AppendStr("--coverage"), ""},
@@ -164,7 +164,7 @@ Rules = [
164164
{[deps], IsRebar3,
165165
Rebar3DepsFilter, []},
166166
{[plugins], IsRebar3,
167-
AppendList([rebar3_hex, pc, provider_asn1]), []},
167+
AppendList([pc, provider_asn1]), []},
168168
{[provider_hooks], IsRebar3,
169169
AppendList([{pre, [
170170
{compile, {pc, compile}},
@@ -174,8 +174,8 @@ Rules = [
174174
]}]), []},
175175
{[plugins], os:getenv("COVERALLS") == "true",
176176
AppendList([{coveralls, {git,
177-
"https://github.com/RoadRunnr/coveralls-erl.git",
178-
{branch, "feature/git-info"}}} ]), []},
177+
"https://github.com/processone/coveralls-erl.git",
178+
{branch, "addjsonfile"}}} ]), []},
179179
{[deps], os:getenv("USE_GLOBAL_DEPS") /= false,
180180
GlobalDepsFilter, []},
181181
{[erl_opts], true,

vars.config.in

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{with_gcov, "@gcov@"}.
2+
3+
%% Local Variables:
4+
%% mode: erlang
5+
%% End:
6+
%% vim: set filetype=erlang tabstop=8:

0 commit comments

Comments
 (0)