From 3f119faefa0fab8dc8b27ed05e55437deeebf04b Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 21 Oct 2023 12:23:05 -0400 Subject: [PATCH] Use shared CI actions --- .github/workflows/ci.yml | 128 +++++++++++++++++++++++++++++ .github/workflows/issue-notify.yml | 21 +++++ 2 files changed, 149 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..3ea1e1e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,128 @@ +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: >- + Config::ZOMG + Digest::MD5 + Encode + FindBin + HTML::HTML5::Writer + HTTP::Headers + JSON + List::Util + Log::Any::Adapter + Log::Any::Adapter::Screen + Module::Load::Conditional + Moo + MooX::Log::Any + namespace::autoclean + parent + Plack + Plack::Middleware::CrossOrigin + Plack::Middleware::Expires + RDF::Endpoint + RDF::Generator::Void + RDF::Helper::Properties + RDF::NS::Curated + RDF::RDFa::Generator + RDF::RDFa::Parser + RDF::Trine + RDF::Trine::Serializer::RDFa + RDF::TrineX::Compatibility::Attean + Scalar::Util + Test::Exception + Test::JSON + Test::More + Test::RDF + Test::WWW::Mechanize::PSGI + Try::Tiny + Types::Standard + URI + URI::NamespaceMap + 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