diff options
author | brian d foy <briandfoy@pobox.com> | 2022-08-27 08:03:21 -0400 |
---|---|---|
committer | brian d foy <briandfoy@pobox.com> | 2022-08-27 08:03:21 -0400 |
commit | 417723be1bb926e6fc3948e16d673e92f9a35537 (patch) | |
tree | ef73891bdfe1640e6ccdb3239b249a3f63179117 | |
parent | 3cf92ff51dad183e4d2c9c050277d81b1c4efd34 (diff) |
Update macos workflow
-rw-r--r-- | .github/workflows/macos.yml | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b1f0638..5bb1b85 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,3 +1,8 @@ +# brian's standard GitHub Actions macOS config for Perl 5 modules +# version 20220825.001 +# https://github.com/briandfoy/github_workflows +# https://github.com/features/actions +# This file is licensed under the Artistic License 2.0 name: macos on: @@ -6,22 +11,27 @@ on: - '**' - '!**windows**' - '!**linux**' + - '!**release**' tags-ignore: + # I tag release pushes but those should have already been tested - 'release-*' paths-ignore: + # list all the files which are irrelevant to the tests + # non-code, support files, docs, etc - '.appveyor.yml' - - '.github/workflows/ubuntu.yml' + - '.gitattributes' - '.github/workflows/windows.yml' + - '.github/workflows/release.yml' - '.gitignore' - '.releaserc' - 'Changes' - 'LICENSE' - 'README.pod' pull_request: + jobs: perl: runs-on: macOS-latest - environment: testing steps: - uses: actions/checkout@v2 - name: Platform check @@ -33,10 +43,23 @@ jobs: perl -v | perl -0777 -ne 'm/(v5\.\d+)/ && print "PERL_VERSION=$1"' >> $GITHUB_ENV - name: Perl version check run: perl -V +# cpan can operate with https, but we need IO::SSL::Socket, which +# does not come with Perl. +# +# When using cpan, use -M to specify the CDN-backed www.cpan.org +# mirror. I've noticed that letting CPAN.pm auto-choose mirrors +# sometimes selects things that the action can't reach. +# +# Also, use the -T option to not test the dependencies. Assume these +# mainline modules are good and save lots of CI minutes. - name: Prepare cpan run: | openssl version - cpan -M https://www.cpan.org -T Net::SSLeay IO::Socket::SSL LWP::Protocol::https ExtUtils::MakeMaker + cpan -M http://www.cpan.org -T IO::Socket::SSL HTTP::Tiny + cpan -M https://www.cpan.org -T ExtUtils::MakeMaker Test::Manifest +# Install the dependencies, again not testing them. This installs the +# module in the current directory, so we end up installing the module, +# but that's not a big deal. - name: Install dependencies run: | cpan -M https://www.cpan.org -T . @@ -44,18 +67,38 @@ jobs: run: | perl Makefile.PL make test +# Run author tests, but only if there's an xt/ directory + - name: Author tests + if: hashFiles('xt') != '' + run: | + cpan -M https://www.cpan.org -T Test::CPAN::Changes + prove -r -b xt +# Running tests in parallel should be faster, but it's also more +# tricky in cases where different tests share a feature, such as a +# file they want to write to. Parallel tests can stomp on each other. +# Test in parallel to catch that, because other people will test your +# stuff in parallel. - name: Run tests in parallel run: | perl Makefile.PL HARNESS_OPTIONS=j10 make test +# The disttest target creates the distribution, unwraps it, changes +# into the dist dir, then runs the tests there. That checks that +# everything that should be in the dist is in the dist. If you forget +# to update MANIFEST with new modules, data files, and so on, you +# should notice the error. - name: Run distribution tests run: | perl Makefile.PL make disttest + make clean +# And, coverage reports, but only under 5.10 and later since modern +# Devel::Cover instances don't work with 5.8 - name: Run coverage tests if: env.PERL_VERSION != 'v5.8' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls + perl Makefile.PL cover -test -report coveralls |