Skip to content

Commit

Permalink
update packages existence checking + dependencies after cpan build
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepassio committed Dec 27, 2024
1 parent 62f5134 commit 7229c3b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/test-cpan-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ jobs:
- name: "Statistics::Regression"
build_distribs: "bullseye"
version: "0.53"
- name: "WWW::Selenium"
deb_dependencies: "libcarp-always-perl libdata-dumper-compact-perl libexporter-tiny-perl libhttp-headers-fast-perl libhttp-request-ascgi-perl libio-socket-ssl-perl liblwp-useragent-determined-perl libtest-simple-perl libtest-more-utf8-perl liburi-escape-xs-perl libclass-base-perl"
- name: "ZMQ::LibZMQ4"
version: "0.01"
deb_dependencies: "libzmq5"
Expand All @@ -390,26 +392,25 @@ jobs:
id: package-version
run: |
if [ -z "${{ matrix.version }}" ]; then
CPAN_PACKAGE_VERSION=$(cpanm --info ${{ matrix.name }} | sed 's/\.tar\.gz$//' | sed 's/.*\-//' | sed 's/v//')
cpan_info=$(cpanm --info ${{ matrix.name }})
CPAN_PACKAGE_VERSION=$cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//' | sed 's/v//')
if [[ ! $CPAN_PACKAGE_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}"
exit 1
fi
PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}"
else
PACKAGE_VERSION="${{ matrix.version }}"
fi
echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT
CPAN_PACKAGE_NAME=$cpan_info | sed 's/.*\///g' | sed 's/-[0-9\.]*\.tar\.gz//g' | tr '[:upper:]' '[:lower:]')
echo "package_name=$(echo $CPAN_PACKAGE_NAME)" >> $GITHUB_OUTPUT
shell: bash

- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
name: Check if package already exists
run: |
package_name=$(echo "lib${{ matrix.name }}-perl" | sed 's/::/-/g' | tr '[:upper:]' '[:lower:]')
package_info=$(apt-cache policy $package_name)
package_info=$(apt-cache policy ${{ steps.package-version.outputs.package_name }})
if [[ -n $package_info ]]; then
echo "Package already exists in the repository."
candidate_version=$(echo "$package_info" | grep 'Candidate:' | awk '{print $2}')
Expand Down

0 comments on commit 7229c3b

Please sign in to comment.