Skip to content

Commit

Permalink
GitHub actions (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncs authored Oct 16, 2024
1 parent 2d39fe4 commit fea0b80
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 45 deletions.
69 changes: 46 additions & 23 deletions .github/workflows/dzil_tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,56 @@ jobs:
fail-fast: false
matrix:
perl-version:
- latest
- 5.40
- 5.38
- 5.36
- 5.34
- 5.32
- 5.30
- 5.28
- 5.26
- 5.24
- 5.22
- 5.20
- 5.18
- 5.16
- 'devel'
- 'latest'
- '5.40'
- '5.38'
- '5.36'
- '5.34'
- '5.32'
- '5.30'
- '5.28'
- '5.26'
- '5.24'
- '5.22'
- '5.20'
- '5.18'
- '5.16'
include:
- perl-version: '5.38'
os: ubuntu-latest
coverage: true
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}

name: Perl ${{ matrix.perl-version }}

steps:
- uses: actions/checkout@v2
- name: Regular tests
run: |
cpanm -n -f Pod::Coverage::TrustPod Test::Perl::Critic Test::Pod::Coverage Test::Pod
perl Build.PL
perl Build test
- uses: actions/checkout@main
- name: Amend PATH
run: echo "${GITHUB_WORKSPACE}/t/bin" >> $GITHUB_PATH
- name: Current env
run: env
- name: Perl info
run: perl -V
- name: CPAN test modules
run: cpanm -n Pod::Coverage::TrustPod Test::Perl::Critic Test::Pod::Coverage Test::Pod Test::Trap
- name: CPAN build modules
run: cpanm -n Tk X11::Protocol X11::Protocol::Other
- name: Initial Build
run: perl Build.PL
- name: Build the MANIFEST
run: perl Build manifest
- name: Test suite
if: ${{ !matrix.coverage }}
run: perl Build test
env:
- COVERAGE=1
- RELEASE_TESTING=1
- AUTHOR_TESTING=1
RELEASE_TESTING: 1
AUTHOR_TESTING: 1
- name: Coverage tests
if: ${{ matrix.coverage }}
run: perl Build test
env:
COVERAGE: 1
RELEASE_TESTING: 1
AUTHOR_TESTING: 1
3 changes: 2 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Revision history for {{$dist->name}}

4.17_01 ????-??-?? Duncan Ferguson <[email protected]>
4.17 2024-10-16 Duncan Ferguson <[email protected]>
- Swap the hostname lookup macro from DNS to using the system hostname (Github issue #158)
- Swap from using Travis-CI to Github Actions
- Fix tests on perl 5.38 and 5.40 (Github Issue #153)

4.16 2020-06-20 Duncan Ferguson <[email protected]>
- Further fix for 'resolve_names' error when adding hosts via the UI
Expand Down
2 changes: 1 addition & 1 deletion lib/App/ClusterSSH.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package App::ClusterSSH;
# ABSTRACT: Cluster administration tool
# ABSTRACT: Cluster administration tool

use version; our $VERSION = version->new('4.16');
use version; our $VERSION = version->new('4.17');

=head1 SYNOPSIS
Expand Down
15 changes: 8 additions & 7 deletions lib/App/ClusterSSH/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -304,30 +304,31 @@ sub parent {
sub sort {
my $self = shift;

my $sort = sub { sort @_ };

return $sort unless $self->config()->{'use_natural_sort'};

# if the user has asked for natural sorting we need to include an extra
# module
if ( $self->config()->{'use_natural_sort'} ) {
my $config = $self->config();

# Make sure the configuration object has been set correctly before
# referencing anything
if ( ref $config eq "HASH" && $config->{'use_natural_sort'} ) {
eval { Module::Load::load('Sort::Naturally'); };
if ($@) {
warn(
"natural sorting requested but unable to load Sort::Naturally: $@\n"
);
}
else {
$sort = sub { Sort::Naturally::nsort(@_) };
my $sort = sub { Sort::Naturally::nsort(@_) };
return $sort;
}
}

my $sort = sub { sort @_ };
return $sort;
}

1;


=head1 METHODS
These extra methods are provided on the object
Expand Down
2 changes: 1 addition & 1 deletion lib/App/ClusterSSH/Window.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sub import {
my ($class) = @_;

# If we are building or in test here, just exit
# as travis build servers will not have Tk installed
# as the build servers will not have Tk installed
if ($ENV{AUTHOR_TESTING} || $ENV{RELEASE_TESTING}) {
print STDERR "skipping initialisation; AUTHOR_TESTING or RELEASE_TESTING are set\n";
return;
Expand Down
15 changes: 3 additions & 12 deletions t/pod-coverage.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@ use strict;
use warnings;
use Test::More;

# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all =>
"Test::Pod::Coverage $min_tpc required for testing POD coverage"
if $@;
eval "use Test::Pod::Coverage 1.00";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;

# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
if $@;
plan skip_all => "Skipping coverage tests" unless $ENV{COVERAGE};

all_pod_coverage_ok();

0 comments on commit fea0b80

Please sign in to comment.