Skip to content

Commit

Permalink
Added code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 4, 2024
1 parent bf6eeed commit af93c14
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 9 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# https://github.com/codecov/example-perl/blob/master/github.yml
name: Code coverage - codecov.io

on:
pull_request:
push:
branches:
- '*'
tags-ignore:
- '*'

jobs:
build:
runs-on: ubuntu-latest
name: codecov
container:
image: perl:stable
steps:
- uses: actions/checkout@v4
- uses: codecov/codecov-action@v4
- name: Install Dependencies
run: |
cpanm --quiet --notest --installdeps .
cpanm --quiet --notest Module::Build Devel::Cover Devel::Cover::Report::Codecov
- name: Build module
run: |
perl Makefile.PL
make
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
- name: Download codecov
run: |
# Replace `linux` below with the appropriate OS
# Options are `alpine`, `linux`, `macos`, `windows`
# curl -Os https://uploader.codecov.io/latest/linux/codecov
# chmod +x codecov
- name: Submit codecov
run: |
cover -test
cover -report codecov
# ./codecov -t ${{ secrets.CODECOV_TOKEN }} -f cover_db/codecov.json
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Code coverage - coveralls.io

on:
pull_request:
push:
branches:
- '*'
tags-ignore:
- '*'

jobs:
build:
runs-on: ubuntu-latest
name: coveralls
container:
image: perl:stable
steps:
- uses: actions/checkout@v4
# - run: cpanm --quiet --notest --installdeps .
# - run: cpanm --quiet --notest App::Yath Devel::Cover Devel::Cover::Report::Coveralls UUID
# - run: PERL5OPT="-MDevel::Cover" yath test --qvf t/
- name: Install Dependencies
run: |
cpanm --quiet --notest --installdeps .
cpanm --quiet --notest Module::Build Devel::Cover Devel::Cover::Report::Coveralls
- name: Build module
run: |
perl Makefile.PL
make
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
- name: Submit coveralls
run: |
cover -test
cover -report coveralls
# ./codecov -t ${{ secrets.COVERALLS_TOKEN }} -f cover_db/codecov.json
env:
GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
21 changes: 12 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,26 @@ jobs:
- run: perl -V
- name: Install Dependencies
run: |
cpanm -iqn --skip-satisfied File::Spec ExtUtils::MakeMaker Devel::Cover::Report::Codecov
cpanm -iqn --skip-satisfied File::Spec ExtUtils::MakeMaker
cpanm -iqn --skip-satisfied Test::Script Test::Pod::Spelling::CommonMistakes Test::Portability::Files Test::Taint Test::Carp Test::Pod::Coverage
cpanm -iqn --skip-satisfied --installdeps --notest .
- name: Make Module
run: |
# find . -name build.log | xargs cat
perl Makefile.PL
make
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
- name: Run Tests
# run: prove -l -b t
run: |
cover -test
cover -report codecov
curl -Os https://uploader.codecov.io/latest/macos/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}
run: prove -l -b t
# run: |
# cover -test
# cover -report codecov
# curl -Os https://uploader.codecov.io/latest/macos/codecov
# chmod +x codecov
# ./codecov -t ${{ secrets.CODECOV_TOKEN }}
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit af93c14

Please sign in to comment.