Skip to content

CI

CI #92

Workflow file for this run

name: CI
on:
push:
branches: '*'
pull_request:
branches: '*'
schedule:
- cron: '42 5 * * *'
# Build the module on several versions of Perl using an image that already has a lot of modules installed.
# This will provide a fast feedback if a commit broke anything in the unit-tests.
# Using 5.32 we also create the tar.gz file and save it as an artifact.
#
# Once this job passed we launch several jobs in parallel
# 1) Verify that we can install the created distribution on many versions of Perl using a Linux Docker image with vanilla Perl.
# 2) Verify that we can install the created distribution on native Linux/Windows/OSX.
# 3) Verify that the changes won't break some selected downstream distributions.
# We run the job on every push and every pull-request.
# We also run them periodically to makes sure none of changes in our dependencies break it even during the days when
# the developers of this project rest.
jobs:
build-in-container:
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
fail-fast: false
matrix:
perl-version:
- '5.32'
- '5.30'
- '5.20'
container:
image: perldocker/perl-tester:${{ matrix.perl-version }} # https://hub.docker.com/r/perldocker/perl-tester
name: Build on Linux with Perl ${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
perl -v
cpanm --notest Module::Install
cpanm --notest Contextual::Return
cpanm --notest Test::Pod
cpanm --notest Test::Pod::Coverage
cpanm --notest Test::Perl::Critic
apt-get update
apt-get install -y libreadline-dev
cpanm --installdeps --notest .
- name: Regular tests
env:
RELEASE_TESTING: 1
run: |
perl Makefile.PL
make
make test
- name: Create release
if: ${{ matrix.perl-version == '5.32' }}
run: |
# Increase the version number by 0.000001 so in the reports we can be sure we are using the code to be released.
perl -i -p -e "s/VERSION\s*=\s*'(\d+\.\d+)'/q{VERSION = '} . (\$1 + 0.01) . q{'}/e" lib/Debug/Client.pm
perl Makefile.PL
make
make manifest
make dist
- name: Archive artifacts
if: ${{ matrix.perl-version == '5.32' }}
uses: actions/upload-artifact@v4
with:
name: the-release
path: |
Debug-Client-*.tar.gz
test-on-clean-perl:
runs-on: ubuntu-latest
needs: build-in-container
strategy:
fail-fast: false
matrix:
perl-version:
- '5.41.5'
- '5.40'
- '5.38'
- '5.36'
- '5.34'
- '5.32'
- "5.30"
- "5.28"
- "5.26"
#- "5.24"
#- "5.22"
#- "5.20"
#- "5.18"
#- "5.16"
#- "5.14"
#- "5.12"
#- "5.10"
container:
image: perl:${{ matrix.perl-version }}
env:
TERM: xterm-256color
name: Test on ${{ matrix.perl-version }}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: the-release
- name: Install System level dependency
run: |
apt-get update
apt-get install -y libreadline-dev
- name: Install Module
run: |
perl -v
cpanm --verbose Debug-Client-*.tar.gz
native:
needs: build-in-container
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
#runner: [windows-latest]
perl: [ '5.32' ]
runs-on: ${{matrix.runner}}
name: Native on OS ${{matrix.runner}} Perl ${{matrix.perl}}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: the-release
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
distribution: ${{ ( startsWith( matrix.runner, 'windows-' ) && 'strawberry' ) || 'default' }}
- name: Install Module on Windows
if: ${{ startsWith( matrix.runner, 'windows-' ) }}
run: |
perl -v
Set-Content -NoNewline "cpanm --verbose " install.bat
Get-ChildItem -Name Debug-Client* >> install.bat
dir
type install.bat
.\install.bat
perl -MDebug::Client -e "print qq{$Debug::Client::VERSION\n}"
- name: Install Module on Linux
if: ${{ startsWith( matrix.runner, 'ubuntu-' ) }}
env:
TERM: xterm-256color
run: |
sudo apt-get update
sudo apt-get install -y libreadline-dev
cpanm --verbose Debug-Client-*.tar.gz
perl -MDebug::Client -e 'print qq{$Debug::Client::VERSION\n}'
# - name: Install Module on Mac OSX
# if: ${{ startsWith( matrix.runner, 'macos-' ) }}
# run: |
# #?? apt-get install -y libreadline-dev
# cpanm --verbose Debug-Client-*.tar.gz
# perl -MDebug::Client -e 'print qq{$Debug::Client::VERSION\n}'