|
| 1 | +# brian's standard GitHub Actions Ubuntu config for Perl 5 modules |
| 2 | +# https://github.com/briandfoy/github_actions |
| 3 | +# https://github.com/features/actions |
| 4 | +# This file is licensed under the Artistic License 2.0 |
1 | 5 | name: ubuntu |
2 | 6 |
|
3 | 7 | on: |
4 | 8 | push: |
5 | 9 | branches: |
6 | | - - '*' |
| 10 | + - '**' |
| 11 | + - '!**windows**' |
| 12 | + - '!**macos**' |
7 | 13 | tags-ignore: |
8 | | - - '*' |
| 14 | + # I tag release pushes but those should have already been tested |
| 15 | + - 'release-*' |
| 16 | + paths-ignore: |
| 17 | + # list all the files which are irrelevant to the tests |
| 18 | + # non-code, support files, docs, etc |
| 19 | + - '.appveyor.yml' |
| 20 | + - '.github/workflows/macos.yml' |
| 21 | + - '.github/workflows/windows.yml' |
| 22 | + - '.gitignore' |
| 23 | + - '.releaserc' |
| 24 | + - 'Changes' |
| 25 | + - 'LICENSE' |
| 26 | + - 'README.pod' |
9 | 27 | pull_request: |
10 | 28 |
|
11 | 29 | jobs: |
@@ -38,17 +56,58 @@ jobs: |
38 | 56 | - name: Platform check |
39 | 57 | run: uname -a |
40 | 58 | - name: Perl version check |
41 | | - run: perl -V |
| 59 | + run: | |
| 60 | + perl -V |
| 61 | + perl -v | perl -0777 -ne 'm/(v5\.\d+)/ && print "PERL_VERSION=$1"' >> $GITHUB_ENV |
| 62 | +# Some older versions of Perl have trouble with hostnames in certs. I |
| 63 | +# haven't figured out why. |
| 64 | + - name: Setup environment |
| 65 | + run: | |
| 66 | + echo "PERL_LWP_SSL_VERIFY_HOSTNAME=0" >> $GITHUB_ENV |
| 67 | +# I had some problems with openssl on Ubuntu, so I punted by installing |
| 68 | +# cpanm first, which is easy. I can install IO::Socket::SSL with that, |
| 69 | +# then switch back to cpan. I didn't explore this further, but what you |
| 70 | +# see here hasn't caused problems for me. |
| 71 | +# Need HTTP::Tiny 0.055 or later. |
42 | 72 | - name: Install cpanm and multiple modules |
43 | 73 | run: | |
44 | 74 | curl -L https://cpanmin.us | perl - App::cpanminus |
45 | | - cpanm --notest IO::Socket::SSL |
46 | | - cpanm --notest App::Cpan |
| 75 | + cpanm --notest IO::Socket::SSL App::Cpan ExtUtils::MakeMaker HTTP::Tiny |
47 | 76 | cpan -M https://www.cpan.org -T ExtUtils::MakeMaker |
| 77 | +# Install the dependencies, again not testing them. This installs the |
| 78 | +# module in the current directory, so we end up installing the module, |
| 79 | +# but that's not a big deal. |
48 | 80 | - name: Install dependencies |
49 | 81 | run: | |
50 | 82 | cpan -M https://www.cpan.org -T . |
51 | 83 | - name: Run tests |
52 | 84 | run: | |
53 | 85 | perl Makefile.PL |
54 | 86 | make test |
| 87 | +# Running tests in parallel should be faster, but it's also more |
| 88 | +# tricky in cases where different tests share a feature, such as a |
| 89 | +# file they want to write to. Parallel tests can stomp on each other. |
| 90 | +# Test in parallel to catch that, because other people will test your |
| 91 | +# stuff in parallel. |
| 92 | + - name: Run tests in parallel |
| 93 | + run: | |
| 94 | + perl Makefile.PL |
| 95 | + HARNESS_OPTIONS=j10 make test |
| 96 | +# The disttest target creates the distribution, unwraps it, changes |
| 97 | +# into the dist dir, then runs the tests there. That checks that |
| 98 | +# everything that should be in the dist is in the dist. If you forget |
| 99 | +# to update MANIFEST with new modules, data files, and so on, you |
| 100 | +# should notice the error. |
| 101 | + - name: Run distribution tests |
| 102 | + run: | |
| 103 | + perl Makefile.PL |
| 104 | + make disttest |
| 105 | +# And, coverage reports, but only under 5.10 and later since modern |
| 106 | +# Devel::Cover instances don't work with 5.8 |
| 107 | + - name: Run coverage tests |
| 108 | + if: env.PERL_VERSION != 'v5.8' |
| 109 | + env: |
| 110 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + run: | |
| 112 | + cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls |
| 113 | + cover -test -report coveralls |
0 commit comments