Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/actions/install-with-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Install Zonemaster-Engine and dependencies"
description: "Installs Zonemaster-Engine and all required dependencies in the container"
inputs:
zonemaster_ldns_branch:
description: |
Which branch of Zonemaster::LDNS to test against:

* “latest”: test against latest stable release;
* “develop”: test against current develop branch.
required: true
default: "develop"
runs:
using: "composite"
steps:
- name: Install binary dependencies
run: |
# * These were taken from the installation instruction.
# * Gettext was added so we can run cpanm . on the Engine sources.
# * The Perl modules were left out because I couldn't get all of them
# to work with custom Perl versions.
# * Cpanminus was left out because actions-setup-perl installs it.
sudo apt-get install -y \
autoconf \
automake \
build-essential \
gettext \
libidn2-dev \
liblog-any-perl \
libssl-dev \
libtool \
m4
shell: bash

- name: Install Zonemaster::LDNS (latest)
if: ${{ inputs.zonemaster_ldns_branch == 'latest' }}
run: |
cpanm --sudo --notest Module::Install ExtUtils::PkgConfig Zonemaster::LDNS
shell: bash

- name: Install Zonemaster::LDNS (develop)
if: ${{ inputs.zonemaster_ldns_branch == 'develop' }}
run: |
cpanm --sudo --notest Devel::CheckLib Module::Install ExtUtils::PkgConfig Module::Install::XSUtil
git clone --branch=develop --depth=1 https://github.com/zonemaster/zonemaster-ldns.git
perl Makefile.PL # Generate MYMETA.yml to appease cpanm .
( cd zonemaster-ldns ; cpanm --sudo --notest . )
rm -rf zonemaster-ldns
shell: bash

# Installing Zonemaster::Engine requires root privileges, because of a
# bug in Mail::SPF preventing normal installation with cpanm as
# non-root user (see link below [1]).
#
# The alternative, if one still wishes to install Zonemaster::Engine
# as non-root user, is to install Mail::SPF first with a command like:
#
# % cpanm --notest \
# --install-args="--install_path sbin=$HOME/.local/sbin" \
# Mail::SPF
#
# For the sake of consistency, other Perl packages installed from CPAN
# are also installed as root.
#
# [1]: https://rt.cpan.org/Public/Bug/Display.html?id=34768
- name: Install remaining dependencies
run: |
cpanm --sudo --verbose --notest --installdeps .
shell: bash

- name: Install Zonemaster::Engine
run: |
cpanm --sudo --verbose --notest .
shell: bash
58 changes: 4 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,60 +35,10 @@ jobs:
with:
perl-version: ${{ matrix.perl }}

- name: Binary dependencies
run: |
# * These were taken from the installation instruction.
# * Gettext was added so we can run cpanm . on the Engine sources.
# * The Perl modules were left out because I couldn't get all of them
# to work with custom Perl versions.
# * Cpanminus was left out because actions-setup-perl installs it.
sudo apt-get install -y \
autoconf \
automake \
build-essential \
gettext \
libidn2-dev \
liblog-any-perl \
libssl-dev \
libtool \
m4 \

- name: Install Zonemaster::LDNS (latest)
if: ${{ matrix.compatibility == 'latest' }}
run: |
cpanm --sudo --notest Module::Install ExtUtils::PkgConfig Zonemaster::LDNS

- name: Install Zonemaster::LDNS (develop)
if: ${{ matrix.compatibility == 'develop' }}
run: |
cpanm --sudo --notest Devel::CheckLib Module::Install ExtUtils::PkgConfig Module::Install::XSUtil
git clone --branch=develop --depth=1 https://github.com/zonemaster/zonemaster-ldns.git
perl Makefile.PL # Generate MYMETA.yml to appease cpanm .
( cd zonemaster-ldns ; cpanm --sudo --notest . )
rm -rf zonemaster-ldns

# Installing Zonemaster::Engine requires root privileges, because of a
# bug in Mail::SPF preventing normal installation with cpanm as
# non-root user (see link below [1]).
#
# The alternative, if one still wishes to install Zonemaster::Engine
# as non-root user, is to install Mail::SPF first with a command like:
#
# % cpanm --notest \
# --install-args="--install_path sbin=$HOME/.local/sbin" \
# Mail::SPF
#
# For the sake of consistency, other Perl packages installed from CPAN
# are also installed as root.
#
# [1]: https://rt.cpan.org/Public/Bug/Display.html?id=34768
- name: Install remaining dependencies
run: |
cpanm --sudo --verbose --notest --installdeps .

- name: Install Zonemaster::Engine
run: |
cpanm --sudo --verbose --notest .
- name: Install Zonemaster-Engine with dependencies
uses: ./.github/actions/install-with-dependencies
with:
zonemaster_ldns_branch: ${{ matrix.compatibility }}

- name: Show content of log files
if: ${{ failure() }}
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code coverage

on:
push:
branches:
- develop
- master
- 'releases/**'
pull_request:
branches:
- develop
- master
- 'releases/**'

jobs:
coverage:
runs-on: ubuntu-22.04
name: Test coverage
steps:
- uses: actions/checkout@v4

- name: Prepare testing environment
run: |
sudo apt install -y cpanminus libdevel-cover-perl && \
cpanm --sudo --notest Devel::Cover::Report::Coveralls

- name: Install module and dependencies
uses: ./.github/actions/install-with-dependencies
with:
zonemaster_ldns_branch: develop

- name: Show content of log files
if: ${{ failure() }}
run: cat /home/runner/.cpanm/work/*/build.log

- name: Run coverage
run: cover -test -report Coveralls
Loading