Browse Source

Add support to send C coverage. Don't cache. Move hex plugin to Action

master
Badlop 11 months ago
parent
commit
2d952f2e40
  1. 27
      .github/workflows/ci.yml
  2. 7
      .github/workflows/hexpm-release.yml
  3. 41
      configure.ac
  4. 6
      rebar.config.script
  5. 6
      vars.config.in

27
.github/workflows/ci.yml

@ -9,33 +9,34 @@ jobs:
strategy:
fail-fast: false
matrix:
otp: ['19.3', '22.3', 24]
otp: ['19.3', '21.3', 24]
runs-on: ubuntu-20.04
container:
image: erlang:${{ matrix.otp }}
steps:
- uses: actions/checkout@v2
- name: Cache rebar3
uses: actions/cache@v2
with:
path: |
~/.cache/rebar3/
key: ${{matrix.otp}}-${{hashFiles('rebar.config')}}
- run: rebar3 compile
- run: rebar3 xref
- run: rebar3 dialyzer
- run: rebar3 eunit -v
cover:
name: Cover
needs: [tests]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: ./configure --enable-gcov
- run: rebar3 compile
- run: rebar3 eunit -v
- run: rebar3 eunit -v
- run: pip install --user cpp-coveralls
- run: cpp-coveralls -b `pwd` --verbose --gcov-options '\-lp' --dump c.json
- name: Send to Coveralls
if: matrix.otp == 24
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COVERALLS=true rebar3 as test coveralls send
ADDJSONFILE=c.json COVERALLS=true rebar3 as test coveralls send
curl -v -k https://coveralls.io/webhook \
--header "Content-Type: application/json" \
--data '{"repo_name":"$GITHUB_REPOSITORY",

7
.github/workflows/hexpm-release.yml

@ -1,4 +1,4 @@
name: hexpm-release
name: Hex
on:
push:
@ -12,6 +12,11 @@ jobs:
- name: Check out
uses: actions/checkout@v2
- name: Setup rebar3 hex
run: |
mkdir -p ~/.config/rebar3/
echo "{plugins, [rebar3_hex]}." > ~/.config/rebar3/rebar.config
- name: Publish to hex.pm
run: DIAGNOSTIC=1 rebar3 hex publish --repo hexpm --yes
env:

41
configure.ac

@ -0,0 +1,41 @@
AC_PREREQ(2.59c)
AC_PACKAGE_VERSION(1.0.0)
AC_PACKAGE_NAME(mqtree)
AC_INIT(mqtree, 1.0.0, [], mqtree)
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_HEADER_STDC
# Checks Erlang runtime and compiler
AC_ERLANG_NEED_ERL
AC_ERLANG_NEED_ERLC
# Checks and sets ERLANG_ROOT_DIR and ERLANG_LIB_DIR variable
# AC_ERLANG_SUBST_ROOT_DIR
# AC_ERLANG_SUBST_LIB_DIR
AC_ARG_ENABLE(gcov,
[AC_HELP_STRING([--enable-gcov], [compile with gcov enabled (default: no)])],
[case "${enableval}" in
yes) gcov=true ;;
no) gcov=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gcov) ;;
esac],[gcov=false])
AC_SUBST(gcov)
AC_CONFIG_FILES([vars.config])
AC_OUTPUT

6
rebar.config.script

@ -140,7 +140,7 @@ Rules = [
{[deps], IsRebar3,
Rebar3DepsFilter, []},
{[plugins], IsRebar3,
AppendList([rebar3_hex, pc]), []},
AppendList([pc]), []},
{[provider_hooks], IsRebar3,
AppendList([{pre, [
{compile, {pc, compile}},
@ -148,8 +148,8 @@ Rules = [
]}]), []},
{[plugins], os:getenv("COVERALLS") == "true",
AppendList([{coveralls, {git,
"https://github.com/RoadRunnr/coveralls-erl.git",
{branch, "feature/git-info"}}} ]), []},
"https://github.com/processone/coveralls-erl.git",
{branch, "addjsonfile"}}} ]), []},
{[deps], os:getenv("USE_GLOBAL_DEPS") /= false,
GlobalDepsFilter, []}
],

6
vars.config.in

@ -0,0 +1,6 @@
{with_gcov, "@gcov@"}.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8:
Loading…
Cancel
Save