v++ #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow perl modules build with Dist::Zilla | |
name: Test Module | |
# Controls when the workflow will run | |
on: [push, pull_request, workflow_dispatch] # disabled for debug | |
#on: [workflow_dispatch] # enable for debug | |
jobs: | |
# fetch and build module | |
Fetch-and-build: | |
runs-on: ubuntu-latest | |
container: ebruni/devel:dzil | |
steps: | |
- name: Checkout Repo Action | |
uses: actions/checkout@main | |
- name: Fix ExtUtils::MakeMaker (for Perl 5.16 and 5.18) | |
run: cpanm -n App::cpanminus ExtUtils::MakeMaker | |
- name: Install missing Dist::Zilla plugins | |
run: dzil authordeps --missing | cpanm -n | |
- name: Set ownership | |
run: | | |
# this is to fix GIT not liking owner of the checkout dir | |
chown -R $(id -u):$(id -g) $PWD | |
- name: Build module | |
run: dzil build | |
- name: "Share builded module" | |
uses: actions/upload-artifact@main | |
with: | |
name: build-share | |
path: ./*.tar.gz | |
test: | |
needs: Fetch-and-build | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
perl-version: | |
- '5.28' | |
- '5.30' | |
- '5.36' | |
- 'latest' | |
container: | |
image: perl:${{ matrix.perl-version }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Download module from previous job | |
uses: actions/download-artifact@main | |
with: | |
name: build-share | |
- name: Create test folder | |
run: mkdir module | |
- name: Uncompress module | |
run: tar zxvf *.gz -C module --strip-components=1 | |
- name: Install dependences | |
working-directory: ./module | |
run: cpanm --installdeps -n . | |
- name: Make module | |
working-directory: ./module | |
run: | | |
perl Makefile.PL | |
make | |
- name: Test module | |
working-directory: ./module | |
run: make test |