Run tests via github actions

Shamelessly adapted from Lab::Measurement
This commit is contained in:
Andreas K. Hüttel 2021-12-17 19:25:45 +01:00
parent 15b392e555
commit 782c1d09d4
No known key found for this signature in database
GPG Key ID: 4C49F79E54D0A206
2 changed files with 49 additions and 0 deletions

28
.github/scripts/prove-test.bash vendored Executable file
View File

@ -0,0 +1,28 @@
# Stop script on first error
set -o errexit
# Prevent "Please tell me who you are" errors for certain DZIL configs
git config --global user.name 'github-actions'
# check perl version
perl --version
#
# Install Dist::Zilla and module dependencies
#
cpanm -n Dist::Zilla
# Install DZIL plugins etc if needed
cd $GITHUB_WORKSPACE
dzil authordeps --missing | grep -vP '[^\w:]' | xargs cpanm -n
dzil listdeps --missing --cpanm | grep -vP '[^\w:~"\.]' | xargs cpanm -n
# dependencies of module tests
cpanm -n HTTP::Server::Simple
#
# Run tests (user tests as well as maintainer tests)
#
prove --verbose -l -s -r t xt

21
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: test
on: [push]
jobs:
'prove-lrt':
runs-on: ubuntu-latest
strategy:
matrix:
perl: ['5.24', '5.26', '5.28', '5.30', '5.32', '5.34']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{matrix.perl}}
- run: lsb_release -a
# run test in script to avoid tedious quoting of bash code
- name: prove-test
run: ./.github/scripts/prove-test.bash
shell: bash