From 24589bab07307c7aaf65c023b14982abe9b7e575 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Tue, 25 May 2021 19:51:54 -0400 Subject: [PATCH 1/2] Skip linking XS code for pure Perl install When `PUREPERL_ONLY=1` set, this prevents the Makefile from having rules that compile the XS code. This is useful to have when building dependencies for deploying to a pure Perl install such as when using `App::FatPacker`. This removes the need to skip over files that end in `perl -V:dlext` (e.g., `.so`, `.dll`, `.dylib`) when copying to a deployment. This should allow for using the `cpanm --pureperl` option so that a pure Perl installation can be requested for all installed distributions. Signed-off-by: Zakariyya Mughal --- Makefile.PL | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.PL b/Makefile.PL index 91174b1..0c1de2a 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -120,6 +120,7 @@ WriteMakefile1( TEST_REQUIRES => \%TEST_DEPS, XS => {map { (my $tgt = $_) =~ s/\.xs$/\.c/; $_ => $tgt; } @XS_FILES}, MAGICXS => 1, + SKIP => [ $loadable_xs ? () : qw(static dynamic) ], depend => {'$(FIRST_MAKEFILE)' => '$(VERSION_FROM)'}, test => {TESTS => join(' ', 't/pp/*.t', ($loadable_xs ? 't/xs/*.t' : ()), 'xt/*.t')}, # Otherwise 'cxinc' isn't defined From 3afa71239ab5289fc69ec53393e3afc1bba56d40 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Wed, 26 May 2021 14:16:24 -0400 Subject: [PATCH 2/2] Add GitHub Actions workflow for testing various configurations This is to test that the tests pass as expected under various versions of Perl both using XS and pure Perl installs. Signed-off-by: Zakariyya Mughal --- .github/workflows/ci.yml | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..81056f0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,100 @@ +name: Run Tests + +on: + push: + branches: + - '*' + pull_request: + +jobs: + dist: + name: Make distribution + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Cache ~/perl5 + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-dist-locallib + path: ~/perl5 + - name: Perl version + run: | + perl -v + - name: Install cpanm + run: | + curl -L https://cpanmin.us | perl - --sudo App::cpanminus + - name: Install local::lib + run: | + cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) + - name: Install author deps + shell: bash + run: | + eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) + cpanm --notest --with-recommends --with-suggests Test::WriteVariants Config::AutoConf Carp inc::latest + - name: Make distribution + shell: bash + run: | + eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) + perl Makefile.PL + make manifest dist DISTVNAME=dist + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: dist + path: ./dist.tar.gz + test: + needs: dist + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + perl: ['5'] + pureperl: [ false, true ] + include: + - { os: 'ubuntu-latest', perl: "5.34" } + - { os: 'ubuntu-latest', perl: "5.32" } + - { os: 'ubuntu-latest', perl: "5.30" } + - { os: 'ubuntu-latest', perl: "5.28" } + - { os: 'ubuntu-latest', perl: "5.26" } + - { os: 'ubuntu-latest', perl: "5.24" } + - { os: 'ubuntu-latest', perl: "5.22" } + - { os: 'ubuntu-latest', perl: "5.20" } + - { os: 'ubuntu-latest', perl: "5.18" } + - { os: 'ubuntu-latest', perl: "5.16" } + - { os: 'ubuntu-latest', perl: "5.14" } + - { os: 'ubuntu-latest', perl: "5.12" } + - { os: 'ubuntu-latest', perl: "5.10" } + - { os: 'ubuntu-latest', perl: "5.8" } + - { os: 'ubuntu-latest', perl: "5" , pureperl: true, force_cc_fail: true } + name: Perl ${{ matrix.perl }} on ${{ matrix.os }} (${{ format('{0}, {1}', fromJSON('["","pureperl"]')[matrix.pureperl], fromJSON('["","force cc failure"]')[matrix.force_cc_fail]) }}) + + steps: + - name: Get dist artifact + uses: actions/download-artifact@v2 + 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 dist.tar.gz + + - name: Run tests + run: + cpanm --verbose --test-only + ${{ fromJSON('[ "", "--pureperl" ]')[ matrix.pureperl ] }} + ${{ fromJSON('[ "", "--build-args=\"CC=false\"" ]')[ matrix.force_cc_fail ] }} + dist.tar.gz