diff --git a/.github/scripts/prove-test.bash b/.github/scripts/prove-test.bash new file mode 100755 index 0000000..e17fc56 --- /dev/null +++ b/.github/scripts/prove-test.bash @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..416cd8c --- /dev/null +++ b/.github/workflows/test.yml @@ -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 +