From 2bddc1fcafb018996ac88ed1683099d86f2abaed Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 12:23:05 -0400 Subject: [PATCH 1/4] Use shared CI actions --- .github/workflows/ci.yml | 92 ++++++++++++++++++++++++++++++ .github/workflows/issue-notify.yml | 21 +++++++ 2 files changed, 113 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/issue-notify.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..419b7c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: Run Tests + +on: + workflow_dispatch: + push: + branches: + - '*' + tags-ignore: + - '*' + pull_request: + create: + +jobs: + notify: + runs-on: ubuntu-latest + continue-on-error: true + if: ${{ always() }} + steps: + - uses: perlrdf/devops/github-actions/irc-notifications@main + with: + target-notifications: true + dist: + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} + name: Make distribution + runs-on: ubuntu-latest + outputs: + min-perl-version: ${{ steps.build-dist.outputs.min-perl-version }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - id: build-dist + uses: perlrdf/devops/github-actions/build-dist@main + with: + dist-perl-deps-develop: >- + Attean + Test::Signature + Test::Perl::Critic + Test::Pod::Coverage + Test::Pod + Pod::Coverage::Moose + test: + needs: [ 'dist', 'notify' ] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + perl: ['5'] + include: + - { os: 'ubuntu-latest', perl: "5.32" } + - { os: 'ubuntu-latest', perl: "5.30" } + - { os: 'ubuntu-latest', perl: "5.20" } + - { os: 'ubuntu-latest', perl: "5.16" } + - { os: 'ubuntu-latest', perl: "5.14" } + - { os: 'ubuntu-latest', perl: "${{ needs.dist.outputs.min-perl-version }}" } + name: Perl ${{ matrix.perl }} on ${{ matrix.os }} + + steps: + - name: Get dist artifact + uses: actions/download-artifact@v3 + with: + name: dist + + - name: Set up perl + uses: shogo82148/actions-setup-perl@v1 + if: matrix.os != 'windows-latest' + with: + perl-version: ${{ matrix.perl }} + - name: Set up perl (Strawberry) + uses: shogo82148/actions-setup-perl@v1 + if: matrix.os == 'windows-latest' + with: + distribution: 'strawberry' + + - run: perl -V + + - name: Install Perl deps + run: | + cpanm --notest --installdeps . + + - name: Run tests + run: | + cpanm --verbose --test-only . + build-status: + runs-on: ubuntu-latest + continue-on-error: true + if: ${{ always() }} + needs: test + steps: + - uses: perlrdf/devops/github-actions/irc-notifications@main + with: + target-build-status: true + needs: ${{ toJSON(needs) }} diff --git a/.github/workflows/issue-notify.yml b/.github/workflows/issue-notify.yml new file mode 100644 index 0000000..1511a78 --- /dev/null +++ b/.github/workflows/issue-notify.yml @@ -0,0 +1,21 @@ +name: issue-notify + +on: + issues: + types: [opened,assigned,closed,reopened] + issue_comment: + types: [created] + pull_request: + types: [closed,assigned,converted_to_draft,ready_for_review,review_requested] + pull_request_review: + types: [submitted] + +jobs: + notify: + runs-on: ubuntu-latest + continue-on-error: true + if: ${{ always() }} + steps: + - uses: perlrdf/devops/github-actions/irc-notifications@main + with: + target-notifications: true From bf79f0d862041d989162e1929f3ccf1bf0426f49 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 13:24:17 -0400 Subject: [PATCH 2/4] Clean up whitespace --- lib/AtteanX/Compatibility/Trine.pm | 2 +- xt/critic.t | 5 ++--- xt/pod-coverage.t | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/AtteanX/Compatibility/Trine.pm b/lib/AtteanX/Compatibility/Trine.pm index f5a4e49..66824a1 100644 --- a/lib/AtteanX/Compatibility/Trine.pm +++ b/lib/AtteanX/Compatibility/Trine.pm @@ -14,7 +14,7 @@ package Attean::IRI { } package Attean::Blank { - sub blank_identifier { return $_[0]->value } + sub blank_identifier { return $_[0]->value } } package Attean::Literal { diff --git a/xt/critic.t b/xt/critic.t index ba16440..9f0f696 100644 --- a/xt/critic.t +++ b/xt/critic.t @@ -1,5 +1,4 @@ use Test::Perl::Critic(-exclude => [ - 'RequireExtendedFormatting', - ], - -severity => 5); + 'RequireExtendedFormatting', +], -severity => 5); all_critic_ok(); diff --git a/xt/pod-coverage.t b/xt/pod-coverage.t index 2f0c1a0..c7ab80d 100644 --- a/xt/pod-coverage.t +++ b/xt/pod-coverage.t @@ -6,14 +6,14 @@ use Test::More; 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 $@; + 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.02; eval "use Pod::Coverage::Moose $min_pc"; plan skip_all => "Pod::Coverage::Moose $min_pc required for testing POD coverage" - if $@; + if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::Moose'}); From 938de93480d13c5026d90bb7c39f3361803c5cc1 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 13:28:12 -0400 Subject: [PATCH 3/4] Add explicit runtime requirement on Perl version --- meta/makefile.pret | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/makefile.pret b/meta/makefile.pret index 63d3a99..4b8279d 100644 --- a/meta/makefile.pret +++ b/meta/makefile.pret @@ -4,7 +4,8 @@ `AtteanX-Compatibility-Trine` :test-requirement [ :on "Test::More 0.96"^^:CpanId ]; - :runtime-requirement [ :on "Attean 0.019"^^:CpanId ]; + :runtime-requirement [ :on "perl 5.010001"^^:CpanId ]; + :runtime-requirement [ :on "Attean 0.019"^^:CpanId ]; :develop-recommendation [ :on "Dist::Inkt 0.001"^^:CpanId ]; . From 363eb0916630169b439e391ee2c157ca144ff8a9 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 13:40:29 -0400 Subject: [PATCH 4/4] Minimum due to Attean is Perl 5.14 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 419b7c0..35138d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,8 @@ jobs: - { os: 'ubuntu-latest', perl: "5.20" } - { os: 'ubuntu-latest', perl: "5.16" } - { os: 'ubuntu-latest', perl: "5.14" } - - { os: 'ubuntu-latest', perl: "${{ needs.dist.outputs.min-perl-version }}" } + # Not testing this for now due to Attean (requires Perl 5.14) + #- { os: 'ubuntu-latest', perl: "${{ needs.dist.outputs.min-perl-version }}" } name: Perl ${{ matrix.perl }} on ${{ matrix.os }} steps: