Modernize CI pipeline #1
Workflow file for this run
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
name: linux | |
on: | |
push: | |
branches: | |
- '*' | |
tags-ignore: | |
- '*' | |
pull_request: | |
jobs: | |
# | |
# A quick and cheap test first before running other jobs | |
# | |
ubuntu: | |
env: | |
PERL_USE_UNSAFE_INC: 0 | |
AUTHOR_TESTING: 1 | |
AUTOMATED_TESTING: 1 | |
RELEASE_TESTING: 1 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: perl -V | |
- name: uses install-with-cpm | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
cpanfile: "cpanfile" | |
- name: Makefile.PL | |
run: perl -I$(pwd) Makefile.PL | |
- run: make test | |
# | |
# List of Perl Versions available | |
# | |
perl-versions: | |
runs-on: ubuntu-latest | |
name: List Perl versions | |
outputs: | |
perl-versions: ${{ steps.action.outputs.perl-versions }} | |
steps: | |
- id: action | |
uses: perl-actions/perl-versions@v1 | |
with: | |
since-perl: v5.10 | |
with-devel: true | |
# | |
# The Perl matrix on linux | |
# | |
perl: | |
env: | |
PERL_USE_UNSAFE_INC: 0 | |
AUTHOR_TESTING: 1 | |
AUTOMATED_TESTING: 1 | |
RELEASE_TESTING: 1 | |
runs-on: ubuntu-latest | |
needs: [ubuntu,perl-versions] | |
name: "Perl ${{ matrix.perl-version }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
perl-version: ${{ fromJson (needs.perl-versions.outputs.perl-versions) }} | |
container: perldocker/perl-tester:${{ matrix.perl-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: perl -V | |
- name: Deps for testing | |
run: | | |
cpanm --notest Crypt::OpenSSL::Random Crypt::OpenSSL::Guess Test::CPAN::Meta Perl::MinimumVersion Test::Pod::Coverage Test::Pod Test::MinimumVersion Crypt::OpenSSL::Bignum ||: | |
cpanm --notest Crypt::OpenSSL::Random Crypt::OpenSSL::Guess Test::CPAN::Meta Perl::MinimumVersion Test::Pod::Coverage Test::Pod Test::MinimumVersion Crypt::OpenSSL::Bignum | |
# not available < 5.12 | |
cpanm --notest Test::Kwalitee ||: | |
- run: perl Makefile.PL | |
- run: make test | |
# | |
# Windows | |
# | |
windows: | |
env: | |
PERL_USE_UNSAFE_INC: 0 | |
AUTHOR_TESTING: 0 | |
AUTOMATED_TESTING: 1 | |
RELEASE_TESTING: 0 | |
needs: [ubuntu] | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
perl-version: [latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Perl | |
run: | | |
# skip installing perl if it is already installed. | |
if (!(Test-Path "C:\strawberry\perl\bin")) { | |
choco install strawberryperl | |
} | |
echo @" | |
C:\strawberry\c\bin | |
C:\strawberry\perl\site\bin | |
C:\strawberry\perl\bin | |
"@ | | |
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- run: perl -V | |
- name: Deps for testing | |
run: cpanm --notest Crypt::OpenSSL::Random Crypt::OpenSSL::Guess | |
- run: perl Makefile.PL | |
- run: make test |