Skip to content

Commit

Permalink
Merge pull request #3 from zmughal-contrib/ci
Browse files Browse the repository at this point in the history
Use shared CI actions
  • Loading branch information
kjetilk authored Jan 11, 2024
2 parents f5a9759 + 363eb09 commit 2ddbeb2
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 7 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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" }
# 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:
- 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) }}
21 changes: 21 additions & 0 deletions .github/workflows/issue-notify.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/AtteanX/Compatibility/Trine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion meta/makefile.pret
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
.

5 changes: 2 additions & 3 deletions xt/critic.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use Test::Perl::Critic(-exclude => [
'RequireExtendedFormatting',
],
-severity => 5);
'RequireExtendedFormatting',
], -severity => 5);
all_critic_ok();
4 changes: 2 additions & 2 deletions xt/pod-coverage.t
Original file line number Diff line number Diff line change
Expand Up @@ -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'});


0 comments on commit 2ddbeb2

Please sign in to comment.