Skip to content

Commit

Permalink
fix dependencies installation
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepassio committed Dec 13, 2024
1 parent 9c44848 commit 562a1ec
Show file tree
Hide file tree
Showing 2 changed files with 421 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/perl-cpan-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ concurrency:

on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/perl-cpan-libraries.yml"
push:
branches:
- develop
- dev-[2-9][0-9].[0-9][0-9].x
- master
- "[2-9][0-9].[0-9][0-9].x"
paths:
- ".github/workflows/perl-cpan-libraries.yml"
# pull_request:
# paths:
# - ".github/workflows/perl-cpan-libraries.yml"
# push:
# branches:
# - develop
# - dev-[2-9][0-9].[0-9][0-9].x
# - master
# - "[2-9][0-9].[0-9][0-9].x"
# paths:
# - ".github/workflows/perl-cpan-libraries.yml"

jobs:
get-environment:
Expand Down Expand Up @@ -90,6 +90,7 @@ jobs:
- rpm_provides: ""
- version: ""
- spec_file: ""
- no-auto-depends: false
- distrib: el8
package_extension: rpm
image: packaging-plugins-alma8
Expand Down Expand Up @@ -134,7 +135,6 @@ jobs:
version: "0.01"
rpm_dependencies: "zeromq"


name: package ${{ matrix.distrib }} ${{ matrix.name }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
Expand Down Expand Up @@ -622,11 +622,19 @@ jobs:
done
# Install package, then uninstall it with all his dependencies
if [ "${{ matrix.package_extension }}" == "rpm" ]; then
echo "package installation..."
error_output=$(dnf install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
echo "package installation done."
echo "package uninstallation..."
error_output=$(dnf autoremove -y $(echo $package | sed 's/_[0-9].*\.rpm//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
echo "package uninstallation done."
else
echo "package installation..."
error_output=$(apt-get install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
echo "package installation done."
echo "package uninstallation..."
error_output=$(apt-get autoremove -y --purge $(echo $package | sed 's/_[0-9].*\.deb//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
echo "package uninstallation done."
fi
done
# If the file error_log exists and is not empty, the workflow is in error
Expand Down
Loading

0 comments on commit 562a1ec

Please sign in to comment.