Skip to content

Commit ab9b373

Browse files
committed
Add support to send C coverage. Don't cache. Move hex plugin to Action
1 parent 3d6a41b commit ab9b373

3 files changed

Lines changed: 22 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,42 @@ 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-
28-
- run: ./configure --enable-gcov
2918
- run: rebar3 compile
3019
- run: rebar3 xref
3120
- run: rebar3 dialyzer
21+
- run: rebar3 eunit -v
3222

23+
cover:
24+
name: Cover
25+
needs: [tests]
26+
runs-on: ubuntu-20.04
27+
steps:
28+
- uses: actions/checkout@v2
29+
- run: ./configure --enable-gcov
30+
- run: rebar3 compile
3331
- name: Run tests to obtain Erlang coverage
3432
run: |
3533
mv test/unload_test.erl .
3634
rebar3 eunit -v
3735
mv _build/test/cover/eunit.coverdata .
38-
3936
- name: Run tests to obtain C coverage
4037
run: |
4138
mv unload_test.erl test/
4239
rebar3 eunit -v
4340
mv eunit.coverdata _build/test/cover/
44-
41+
- run: pip install --user cpp-coveralls
42+
- run: cpp-coveralls -b `pwd` --verbose --gcov-options '\-lp' --dump c.json
4543
- name: Send to Coveralls
46-
if: matrix.otp == 24
4744
env:
4845
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4946
run: |
50-
COVERALLS=true rebar3 as test coveralls send
47+
ADDJSONFILE=c.json COVERALLS=true rebar3 as test coveralls send
5148
curl -v -k https://coveralls.io/webhook \
5249
--header "Content-Type: application/json" \
5350
--data '{"repo_name":"$GITHUB_REPOSITORY",

.github/workflows/hexpm-release.yml

Lines changed: 6 additions & 1 deletion
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:

rebar.config.script

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ Rules = [
136136
{[deps], IsRebar3,
137137
Rebar3DepsFilter, []},
138138
{[plugins], IsRebar3,
139-
AppendList([rebar3_hex, pc]), []},
139+
AppendList([pc]), []},
140140
{[provider_hooks], IsRebar3,
141141
AppendList([{pre, [
142142
{compile, {pc, compile}},
143143
{clean, {pc, clean}}
144144
]}]), []},
145145
{[plugins], os:getenv("COVERALLS") == "true",
146146
AppendList([{coveralls, {git,
147-
"https://github.com/RoadRunnr/coveralls-erl.git",
148-
{branch, "feature/git-info"}}} ]), []},
147+
"https://github.com/processone/coveralls-erl.git",
148+
{branch, "addjsonfile"}}} ]), []},
149149
{[deps], os:getenv("USE_GLOBAL_DEPS") /= false,
150150
GlobalDepsFilter, []}
151151
],

0 commit comments

Comments
 (0)