Skip to content

Commit

Permalink
Finalizing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Sep 21, 2023
1 parent bd0fce7 commit ee65bdd
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/centos-and-fedora-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,104 @@ jobs:
name: 'RPM ${{ matrix.env.name}}'
path: '~/rpmbuild/SOURCES/RPMS/*.rpm'
retention-days: 5

# The main purpose of this step is to test the RPMS in a pristine environment (as for the end user).
# ci-scripts are deliberately not used, as they recreate the development environment,
# and this is something we proudly reject here

rpm-tests:
runs-on: ubuntu-latest
needs: package
container: ${{ matrix.env.container }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
env:
- { name: 'CentOS 7', container: 'centos:7' }
- { name: 'CentOS 8', container: 'tgagor/centos:stream8' }
- { name: 'CentOS 9', container: 'quay.io/centos/centos:stream9' }
- { name: 'Fedora 35', container: 'fedora:35' }
- { name: 'Fedora 36', container: 'fedora:36' }
name: RPM test on ${{ matrix.env.name }}

steps:
- name: Install prerequisites
run: yum -y install sudo wget binutils

# CentOS 7/8 packages depend on botan.so.16 that gets installed from ribose repo
# Fedora 35/36 packages depend on botan.so.19 that comes Fedora package, that is available by default
# CentOS 9 depend on botan.so.19 and needs EPEL9 repo that needs to be installed
# ribose repo is also a source of json-c (v12 aka json-c12) for CentOS 7

- name: Install ribose-packages
if: matrix.env.container == 'centos:7' || matrix.env.container == 'tgagor/centos:stream8'
run: |
sudo rpm --import https://github.com/riboseinc/yum/raw/master/ribose-packages-next.pub
sudo wget https://github.com/riboseinc/yum/raw/master/ribose.repo -O /etc/yum.repos.d/ribose.repo
- name: Install epel-release
if: matrix.env.container == 'quay.io/centos/centos:stream9'
run: |
sudo dnf -y install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled crb
sudo dnf -y install epel-release
- name: Install xargs
if: matrix.env.container == 'fedora:35'
run: sudo yum -y install findutils

- name: Download rnp rpms
uses: actions/download-artifact@v3
with:
name: 'RPM ${{ matrix.env.name}}'

- name: Checkout shell test framework
uses: actions/checkout@v3
with:
repository: kward/shunit2
path: ci/tests/shunit2

- name: Unstash tests
uses: actions/download-artifact@v3
with:
name: tests
path: ci/tests

- name: Run rpm tests
# RPM tests
# - no source checkout or upload [we get only test scripts from the previous step using GHA artifacts]
# - no environment set up with rnp scripts
# - no dependencies setup, we test that yum can install whatever is required
run: |
chmod +x ci/tests/rpm-tests.sh
ci/tests/rpm-tests.sh
- name: Run symbol visibility tests
run: |
chmod +x ci/tests/ci-tests.sh
sudo yum -y localinstall librnp0-0*.*.rpm librnp0-devel-0*.*.rpm rnp0-0*.*.rpm
ci/tests/ci-tests.sh
sudo yum -y erase $(rpm -qa | grep rnp)
- name: Setup minimalistic build environment
run: |
sudo yum -y install make gcc gcc-c++ zlib-devel bzip2-devel botan2-devel
mkdir cmake
wget https://github.com/Kitware/CMake/releases/download/v3.12.0/cmake-3.12.0-Linux-x86_64.sh -O cmake/cmake.sh
sudo sh cmake/cmake.sh --skip-license --prefix=/usr/local
# Ribose repo provides json-c12-devel for CentOS7;
# el8, el9, fr35, fr36 provide json-c-devel (version 12+)
- name: Setup json-c12
if: matrix.env.container == 'centos:7'
run: sudo yum -y install json-c12-devel

- name: Setup json-c
if: matrix.env.container != 'centos:7'
run: sudo yum -y install json-c-devel

- name: Run packaging tests
run: |
chmod +x ci/tests/pk-tests.sh
ci/tests/pk-tests.sh

0 comments on commit ee65bdd

Please sign in to comment.