From 03097ab1959d40b2417267b5164dc00bd292b4bd Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 12:23:05 -0400 Subject: [PATCH 1/3] Use shared CI actions --- .github/workflows/ci.yml | 97 ++++++++++++++++++++++++++++++ .github/workflows/issue-notify.yml | 21 +++++++ 2 files changed, 118 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..9ebf3da --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,97 @@ +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: >- + Plack::Request + Test::Perl::Critic + Test::RDF + Test::Signature + Test::Pod::Coverage + Test::Pod + Log::Any::Adapter + Test::WWW::Mechanize::PSGI + Config::ZOMG + RDF::LinkedData + 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 45ae37b938059f7b73a720f413e72a5f96d85a24 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 14:59:38 -0400 Subject: [PATCH 2/3] Remove lazy from user attribute Otherwise `Moose` will say: > You cannot have a lazy attribute (user) without specifying a default > value for it --- lib/RDF/LinkedData/RWHypermedia.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RDF/LinkedData/RWHypermedia.pm b/lib/RDF/LinkedData/RWHypermedia.pm index 7dc5c98..e678df9 100644 --- a/lib/RDF/LinkedData/RWHypermedia.pm +++ b/lib/RDF/LinkedData/RWHypermedia.pm @@ -354,7 +354,7 @@ around '_content' => sub { }; -has user => ( is => 'rw', isa => Str, lazy => 1, +has user => ( is => 'rw', isa => Str, predicate => 'is_logged_in', clearer => 'log_out' ); From 6c6d88b4e143dc7d6118b9452c7283df2dd8b32e Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 15:15:59 -0400 Subject: [PATCH 3/3] Comment out minimum Perl job --- .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 9ebf3da..a30493f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,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 + #- { os: 'ubuntu-latest', perl: "${{ needs.dist.outputs.min-perl-version }}" } name: Perl ${{ matrix.perl }} on ${{ matrix.os }} steps: