Skip to content

Commit

Permalink
Added codecov.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 13, 2024
1 parent 1664ca3 commit 7342ac4
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 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 }}
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Revision history for Genealogy::ObituaryDailyTimes

0.13
search() can now just take one parameter which is the last name
Added CircleCI and Codecov

0.12 Wed Jun 19 21:01:56 EDT 2024
t/carp.t could sometimes fail
Expand Down
15 changes: 11 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ use strict;
use warnings;
use ExtUtils::MakeMaker 6.64; # 6.64 for TEST_REQUIRES

my @dirs = (
'lib/Genealogy/ObituaryDailyTimes/data'
);
my @dirs;

if(defined($ENV{'GITHUB_ACTION'}) || defined($ENV{'CIRCLECI'}) || defined($ENV{'TRAVIS_PERL_VERSION'}) || defined($ENV{'APPVEYOR'})) {
# Prevent downloading and installing stuff
warn 'AUTOMATED_TESTING added for you' if(!defined($ENV{'AUTOMATED_TESTING'}));
$ENV{'AUTOMATED_TESTING'} = 1;
$ENV{'NO_NETWORK_TESTING'} = 1;
} elsif(!$ENV{'NO_NETWORK_TESTING'}) {
push @dirs, 'lib/Genealogy/ObituaryDailyTimes/data';
}

# FIXME: AUTOMATED_TESTING - create the empty directory in blib
foreach my $dir(@dirs) {
Expand Down Expand Up @@ -36,7 +43,7 @@ my $prereqs = {
'Text::CSV' => 0
};

unless(defined($ENV{'AUTOMATED_TESTING'})) {
unless(defined($ENV{'NO_NETWORK_TESTING'})) {
$prereqs->{'DBI'} = 0;
$prereqs->{'File::HomeDir'} = 0;
$prereqs->{'HTML::Entities'} = 0;
Expand Down
2 changes: 1 addition & 1 deletion bin/create_db.PL
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ my $dir = 'lib/Genealogy/ObituaryDailyTimes/data';
if(defined($ARGV[0]) && ($ARGV[0] eq '-f')) {
$force_flag++;
} elsif($ENV{'AUTOMATED_TESTING'}) {
exit;
exit(0);
}

if(!-d $dir) {
Expand Down

0 comments on commit 7342ac4

Please sign in to comment.