Skip to content

Build workflow

Build workflow #11

name: Build workflow
run-name: Build workflow
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}
strategy:
matrix:
perl-version:
- '5.24'
- '5.26'
- '5.28'
- '5.30'
- '5.32'
- '5.34'
steps:
- uses: actions/checkout@v4
- name: Install Dzil
run: cpm install -g --no-test Dist::Zilla Dist::Zilla::App::Command::cover ExtUtils::MakeMaker
- name: Install dzil author dependencies
run: |-
cpm install --no-test -g \
-w 2 \
--mirror=http://cpan.cpantesters.org/ $(dzil authordeps --missing)
- name: Install dist deps
run: |
# see https://github.com/team-at-cpan/Dist-Zilla-Plugin-PodInherit/issues/1 to check why we not use
# dzil listdeps --missing directly here
cpanm --installdeps .
dzil listdeps --author --missing --cpanm-versions | xargs cpanm -n
- name: Run Tests
run: dzil smoke --release --author && dzil cover -test -report coveralls && dzil xtest
release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
container:
image: perldocker/perl-tester:5.34
env:
PAUSE_USER: ${{ secrets.PAUSE_USER }}
PAUSE_PASSWORD: ${{ secrets.PAUSE_PASSWORD }}
needs:
- test
steps:
- uses: actions/checkout@v4
- name: Install Dzil
run: cpm install -g --no-test Dist::Zilla Dist::Zilla::App::Command::cover ExtUtils::MakeMaker
- name: Install dzil author dependencies
run: |-
cpm install --no-test -g \
-w 2 \
--mirror=http://cpan.cpantesters.org/ $(dzil authordeps --missing)
- name: Install dist deps
run: |
# see https://github.com/team-at-cpan/Dist-Zilla-Plugin-PodInherit/issues/1 to check why we not use
# dzil listdeps --missing directly here
cpanm --installdeps .
dzil listdeps --author --missing --cpanm-versions | xargs cpanm -n
- name: setup PAUSE account
run: echo -e "user $PAUSE_USER\npassword $PAUSE_PASSWORD\n" >> ~/.pause
- name: setup git
run: |-
git config --global user.email "[email protected]"
git config --global user.name "circleci"
# set remote github because dzil will push to github
# https://metacpan.org/release/DERIV/Dist-Zilla-PluginBundle-Author-DERIV-0.003/source/lib/Dist/Zilla/PluginBundle/Author/DERIV.pm#L122
git remote add github $(git remote get-url origin)
- name: Release to PAUSE
run: |-
if grep -Pzq '\{\{\$NEXT\}\}\n\s*\n' Changes
then
echo "No changes, no need release"
exit 0
fi
# use git push to test permission
git push github master
echo "y\n" | DZIL_CONFIRMRELEASE_DEFAULT=y dzil release