Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use perl-versions in CI #192

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
name: CI

on: [push, pull_request]

jobs:
perl-versions:
runs-on: ubuntu-latest
name: List Perl versions
outputs:
perl-versions: ${{ steps.action.outputs.perl-versions }}
steps:
- id: action
uses: perl-actions/perl-versions@v1
with:
since-perl: v5.8
with-devel: true
test:
needs:
- perl-versions
strategy:
fail-fast: false
matrix:
perl: [ '5.20', '5.22', '5.24', '5.26', '5.28', '5.30', '5.32', '5.34', '5.36', '5.36-threaded' ]
# See options here: https://hub.docker.com/_/perl/tags
perl-version: ${{ fromJson (needs.perl-versions.outputs.perl-versions) }}

runs-on: ubuntu-latest
name: perl ${{matrix.perl}}
container: perl:${{matrix.perl}}
name: perl ${{matrix.perl-version}}
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Show perl version
run: |
perl -v
Expand All @@ -28,4 +42,4 @@ jobs:
run: |
perl Makefile.PL
make
make test
make test
4 changes: 3 additions & 1 deletion t/000.2-warn.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use strict;
use warnings;
use Test::More tests => 1;
use Data::Printer::Common;
use File::Spec;
my $dir_sep_char = File::Spec->catfile('', '');

sub warnings(&) {
my $code = shift;
Expand All @@ -15,4 +17,4 @@ sub warnings(&) {

my $got = warnings { Data::Printer::Common::_warn(undef, "HA!") };

is( $got, "[Data::Printer] HA! at t/000.2-warn.t line 16.\n", 'warn with proper caller/line' );
is( $got, "[Data::Printer] HA! at t${dir_sep_char}000.2-warn.t line 18.\n", 'warn with proper caller/line' );
6 changes: 4 additions & 2 deletions t/026-caller_message.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use strict;
use warnings;
use Test::More tests => 2;
use File::Spec;
my $dir_sep_char = File::Spec->catfile('', '');

BEGIN {
use Data::Printer::Config;
Expand All @@ -19,13 +21,13 @@ my $x;
my $got = p $x;
is(
$got,
'Printing in line 19 of t/026-caller_message.t: undef',
"Printing in line 21 of t${dir_sep_char}026-caller_message.t: undef",
'caller_info shows the proper caller message (after)'
);

$got = p $x, caller_message_position => 'after';
is(
$got,
'undef Printing in line 26 of t/026-caller_message.t:',
"undef Printing in line 28 of t${dir_sep_char}026-caller_message.t:",
'caller_info shows the proper caller message (before)'
);