Skip to content

Commit

Permalink
Add a package test just after his creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepassio committed Jan 13, 2025
1 parent 818b196 commit c275b25
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cpanm App::FatPacker
cpanm File::Copy::Recursive

# For cpan libs
dnf install -y libcurl-devel libssh-devel expat-devel libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
dnf install -y cpio libcurl-devel libssh-devel expat-devel libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
cpanm Module::Build::Tiny
cpanm Module::Install
# Install fpm (ruby 3 is required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cpanm App::FatPacker
cpanm File::Copy::Recursive

# For cpan libs
dnf install -y libcurl-devel libssh-devel expat-devel libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
dnf install -y cpio libcurl-devel libssh-devel expat-devel libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
cpanm Module::Build::Tiny
cpanm Module::Install
# Install fpm (ruby 3 is required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ apt-get install -y \

cpanm Module::Build::Tiny
cpanm Module::Install
cpanm Crypt::OpenSSL::Guess

gem install fpm

echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
Expand All @@ -64,3 +66,7 @@ apt-get install -y nfpm=2.41.0
apt-get clean

EOF

COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb")
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ apt-get install -y nfpm=2.41.0
apt-get clean

EOF

COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb")
4 changes: 4 additions & 0 deletions .github/docker/packaging/Dockerfile.packaging-plugins-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ apt-get install -y nfpm=2.41.0
apt-get clean

EOF

COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb")
16 changes: 13 additions & 3 deletions .github/workflows/perl-cpan-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ jobs:
export SYBASE="/usr"
fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION ${{ matrix.name }}
temp_file=$(mktemp)
created_package=$(fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION ${{ matrix.name }} | tee "$temp_file" | grep "Created package" | grep -oP '(?<=:path=>").*?(?=")')
# Check rpm
rpm2cpio $created_package | cpio -t
shell: bash

- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file != '' }}
Expand Down Expand Up @@ -445,12 +448,19 @@ jobs:
if [ ! -z "${{ matrix.no-auto-depends }}" ]; then
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
fi
fpm -a native -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --iteration ${{ steps.parse-distrib.outputs.package_distrib_name }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES -v ${{ steps.package-infos.outputs.package_version }} ${{ matrix.name }}
temp_file=$(mktemp)
created_package=$(fpm -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --iteration ${{ steps.parse-distrib.outputs.package_distrib_name }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES -v ${{ steps.package-infos.outputs.package_version }} ${{ matrix.name }} | tee "$temp_file" | grep "Created package" | grep -oP '(?<=:path=>").*?(?=")')
# Check deb
dpkg-deb --contents $created_package
shell: bash

- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'true' }}
run: |
DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --dist ${{ matrix.distrib }} --build --version ${{ steps.package-infos.outputs.package_version }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --cpan ${{ matrix.name }}
temp_file=$(mktemp)
created_package=$(DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --dist ${{ matrix.distrib }} --build --version ${{ steps.package-infos.outputs.package_version }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --cpan ${{ matrix.name }} | tee "$temp_file" | grep "building package" | grep -oP "(?<=in '..\/).*.deb(?=')")
# Check deb
dpkg-deb --contents $created_package
shell: bash

- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) }}
Expand Down

0 comments on commit c275b25

Please sign in to comment.