Repository navigation
140 lines (120 loc) · 4.23 KB
/
Copy pathci.yml
File metadata and controls
140 lines (120 loc) · 4.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: CI
on:
push:
branches:
- develop
- master
- 'release/**'
pull_request:
branches:
- develop
- master
- 'release/**'
jobs:
run-tests:
strategy:
matrix:
compatibility:
- develop
#- latest
perl:
- '5.42'
- '5.36'
- '5.26'
runner:
- ubuntu-22.04
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- name: update
run: sudo apt update -y
- 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: Show content of log files
if: ${{ failure() }}
run: cat /home/runner/.cpanm/work/*/build.log
- name: Test
run: |
prove -lv t
build-artifact:
needs: run-tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: update
run: sudo apt update -y
- name: apt install
run: sudo apt-get install -y build-essential git libmodule-install-perl gettext
- name: build
run: perl Makefile.PL && make all dist
- name: Get short SHA
id: short_sha
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_ENV
else
echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
fi
- name: Get Zonemaster-Engine version
id: version
run: |
result=`grep "use version; our $VERSION" lib/Zonemaster/Engine.pm`
result+='printf $VERSION;'
VERSION=`perl -e "$result"`
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: Zonemaster-Engine-${{ steps.version.outputs.version }}-${{ env.SHORT_SHA }}
path: Zonemaster-Engine-${{ steps.version.outputs.version }}.tar.gz