Skip to content

Commit

Permalink
chore(ci): Use Vault for CentOS Stream 8
Browse files Browse the repository at this point in the history
CentOS Stream 8 reached EOL on 2024-05-31. This patch ensures we can
still run EL8-equivalent tests on frozen version of Stream 8.

Since 1.28 only tracks EL8, CentOS Stream 9 specific code is being
dropped as well.
  • Loading branch information
m-horky committed Jun 4, 2024
1 parent 7cf5af5 commit 255aa85
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 43 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/libdnf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
fail-fast: false
matrix:
include:
- name: "CentOS Stream 9"
image: "quay.io/centos/centos:stream9"
- name: "CentOS Stream 8"
image: "quay.io/centos/centos:stream8"

Expand All @@ -25,17 +23,14 @@ jobs:
- name: "Checkout repository"
uses: actions/checkout@v3

- name: "Enable PowerTools repository"
if: ${{ matrix.name == 'CentOS Stream 8' }}
- name: "Use CentOS Vault"
run: |
dnf --setopt install_weak_deps=False install -y dnf-plugins-core
dnf config-manager --enable powertools
sed -i 's|#baseurl=http://mirror|baseurl=http://vault|' /etc/yum.repos.d/CentOS-Stream-*.repo
- name: "Enable CRB repository"
if: ${{ matrix.name == 'CentOS Stream 9' }}
- name: "Enable PowerTools repository"
run: |
dnf --setopt install_weak_deps=False install -y dnf-plugins-core
dnf config-manager --enable crb
dnf config-manager --enable powertools
- name: "Install packages"
run: |
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ jobs:
fail-fast: false
matrix:
include:
- name: "CentOS Stream 9"
image: "quay.io/centos/centos:stream9"
pytest_args: ''
- name: "CentOS Stream 8"
image: "quay.io/centos/centos:stream8"
pytest_args: ''

runs-on: ubuntu-latest
container:
Expand All @@ -33,6 +29,10 @@ jobs:
- name: "Checkout repository"
uses: actions/checkout@v3

- name: "Use CentOS Vault"
run: |
sed -i 's|#baseurl=http://mirror|baseurl=http://vault|' /etc/yum.repos.d/CentOS-Stream-*.repo
- name: "Run container-pre-test.sh"
run: |
bash scripts/container-pre-test.sh
Expand All @@ -46,15 +46,14 @@ jobs:
--cov-report 'xml:/tmp/coverage.xml' --junitxml '/tmp/pytest.xml'"
run: |
dbus-run-session \
python3 -m pytest ${{ matrix.pytest_args }}
python3 -m pytest
- name: "Publish coverage"
uses: MishaKav/pytest-coverage-comment@main
if: |
github.event.pull_request.head.repo.full_name == github.repository
&& matrix.name == 'CentOS Stream 9'
with:
title: "Coverage (computed on ${{ matrix.name }})"
title: "Coverage"
report-only-changed-files: true
pytest-xml-coverage-path: /tmp/coverage.xml
junitxml-path: /tmp/pytest.xml
30 changes: 6 additions & 24 deletions .github/workflows/tito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
include:
- name: "CentOS Stream 8"
image: "quay.io/centos/centos:stream8"
- name: "CentOS Stream 9"
image: "quay.io/centos/centos:stream9"

runs-on: ubuntu-latest
container:
Expand All @@ -27,15 +25,13 @@ jobs:
dnf --setopt install_weak_deps=False install -y \
git-core dnf-plugins-core rpm-build sudo
- name: Enable PowerTools repository
if: ${{ matrix.name == 'CentOS Stream 8' }}
- name: "Use CentOS Vault"
run: |
dnf config-manager --enable powertools
sed -i 's|#baseurl=http://mirror|baseurl=http://vault|' /etc/yum.repos.d/CentOS-Stream-*.repo
- name: Enable CRB repository
if: ${{ matrix.name == 'CentOS Stream 9' }}
- name: Enable PowerTools repository
run: |
dnf config-manager --enable crb
dnf config-manager --enable powertools
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -46,14 +42,7 @@ jobs:
run: |
git config --global --add safe.directory '*'
- name: Install npm (Fedora)
if: ${{ startsWith(matrix.name, 'Fedora') }}
run: |
dnf --setopt install_weak_deps=False install -y \
nodejs-npm
- name: Install npm (CentOS)
if: ${{ startsWith(matrix.name, 'CentOS') }}
- name: Install npm
run: |
dnf --setopt install_weak_deps=False install -y \
npm
Expand All @@ -64,14 +53,7 @@ jobs:
-D '%global python3_pkgversion 3' \
subscription-manager.spec
- name: Install tito (using DNF)
if: ${{ startsWith(matrix.name, 'Fedora') }}
run: |
dnf --setopt install_weak_deps=False install -y \
tito
- name: Install tito (using pip)
if: ${{ startsWith(matrix.name, 'CentOS') }}
- name: Install tito
run: |
dnf --setopt install_weak_deps=False install -y \
python3-pip python3-setuptools
Expand Down
3 changes: 0 additions & 3 deletions scripts/container-pre-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ source /etc/os-release
if [[ $ID == "centos" && $VERSION == "8" ]]; then
dnf config-manager --enable powertools
fi
if [[ $ID == "centos" && $VERSION == "9" ]]; then
dnf config-manager --enable crb
fi

# Install system, build and runtime packages
dnf --setopt install_weak_deps=False install -y \
Expand Down

0 comments on commit 255aa85

Please sign in to comment.