Skip to content

[dependabot]: Bump pulpcore from 3.63.3 to 3.63.4 in /automation #226

[dependabot]: Bump pulpcore from 3.63.3 to 3.63.4 in /automation

[dependabot]: Bump pulpcore from 3.63.3 to 3.63.4 in /automation #226

name: Check Requirements Update
on:
pull_request:
paths:
- 'automation/requirements.txt'
- '.github/workflows/requirement-check.yml'
env:
GIT_AUTHOR_NAME: Foreman Packaging Automation
GIT_AUTHOR_EMAIL: [email protected]
PACKAGE_TO_UPDATE: requirements.txt
PULPCORE_REQUIREMENTS: automation/requirements.txt
jobs:
rpm_list:
name: 'Check Package to Update'
needs: check_resolution
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'dependabot')
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get install -y --no-install-recommends python3-rpm rpm git-annex python3-semver
sudo curl --create-dirs -o /usr/local/bin/spectool https://pagure.io/rpmdevtools/raw/26a8abc746fba9c0b32eb899b96c92841a37855a/f/spectool.in
sudo curl --create-dirs -o /usr/local/bin/rpmdev-bumpspec https://pagure.io/rpmdevtools/raw/6f387c1deaa5cbed770310e288abde04b17421dc/f/rpmdev-bumpspec
sudo curl --create-dirs -o /usr/local/bin/rpmdev-vercmp https://pagure.io/rpmdevtools/raw/79740e6f1881e399b0b4340a8090dd5adc91a4ea/f/rpmdev-vercmp
printf '#!/bin/bash\necho "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>"' | sudo tee /usr/local/bin/rpmdev-packager
sudo chmod +x /usr/local/bin/spectool /usr/local/bin/rpmdev-*
- name: Sort Updated Libs
run: git diff --unified=0 origin/rpm/develop..pull/${GITHUB_REF_NAME} automation/requirements.txt | grep -Po '(?<=^\+)(?!\+\+).*' > $PACKAGE_TO_UPDATE
- name: Check if package can be updated
run: |
set +e
while read line; do
pkg=${line%==*}
pr_version=${line#*==}
rpm_version=$(rpmspec -q --queryformat='%{version}' packages/python-$pkg/python-$pkg.spec --srpm)
rpmdev-vercmp $rpm_version $pr_version
exit_code=$?
if [ 12 -eq $exit_code ];
then
echo "RPM for Package $pkg needs to be updated from $rpm_version to $pr_version"
exit 0
fi
if [ 0 -eq $exit_code ];
then
echo "Package $pkg version is the same as the packaged RPM"
exit 1
fi
if [ 11 -eq $exit_code ];
then
echo "Packaged $pkg RPM is newer than version in requirements"
exit 1
fi
done < $PACKAGE_TO_UPDATE
check_resolution:
name: Check Package Installation
runs-on: ubuntu-latest
container:
image: quay.io/centos/centos:stream9
steps:
- uses: actions/checkout@v4
- name: Install dnf-plugins-core
run: dnf install 'dnf-command(config-manager)' -y && dnf config-manager --set-enabled crb
- name: Install Required Packages
run: dnf install -y gobject-introspection-devel cairo-gobject-devel cairo-devel gcc make cmake python3.11-devel python3.11-wheel python3.11-pip
- name: Install Pulp using requirements.txt
run: pip3.11 install -r $PULPCORE_REQUIREMENTS