|
| 1 | +name: RHEL UBI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + paths-ignore: |
| 7 | + - AUTHORS.md |
| 8 | + - CC-BY-4.0.txt |
| 9 | + - CHANGES.md |
| 10 | + - CODE_OF_CONDUCT.md |
| 11 | + - CONTRIBUTING.md |
| 12 | + - COPYING |
| 13 | + - COPYING.LIB |
| 14 | + - HISTORY |
| 15 | + - LICENSE-2.0.txt |
| 16 | + - MISSING |
| 17 | + - MIT.txt |
| 18 | + - README.md |
| 19 | + - RELEASE |
| 20 | + - TODO |
| 21 | + - 'contrib/**' |
| 22 | + - 'data/**' |
| 23 | + - 'doc/**' |
| 24 | + - 'po/**' |
| 25 | + - 'regress/**' |
| 26 | + |
| 27 | +jobs: |
| 28 | + centos: |
| 29 | + # Use containers on their ubuntu latest image |
| 30 | + runs-on: ubuntu-latest |
| 31 | + |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + container: ["registry.access.redhat.com/ubi9/ubi:latest"] |
| 35 | + |
| 36 | + container: |
| 37 | + image: ${{ matrix.container }} |
| 38 | + |
| 39 | + # All of these steps run from within the main source |
| 40 | + # directory, so think of that as your $PWD |
| 41 | + steps: |
| 42 | + # Requirements before the git clone can happen |
| 43 | + - name: git clone requirements |
| 44 | + run: | |
| 45 | + case "${{ matrix.container }}" in |
| 46 | + *ubi9) |
| 47 | + # UBI by itself does not contain every BR we |
| 48 | + # need, so supplement with CentOS Stream 9 |
| 49 | + if [ -d /etc/yum.repos.d ]; then |
| 50 | + rm -f /etc/yum.repos.d/ubi.repo |
| 51 | + else |
| 52 | + mkdir -p /etc/yum.repos.d |
| 53 | + fi |
| 54 | +
|
| 55 | + for c in BaseOS AppStream CRB ; do |
| 56 | + echo "[c9s-${c}]" >> /etc/yum.repos.d/ubi.repo |
| 57 | + echo "name = CentOS Stream 9 - ${c}" >> /etc/yum.repos.d/ubi.repo |
| 58 | + echo "baseurl = https://mirror.stream.centos.org/9-stream/${c}/\$basearch/os/" >> /etc/yum.repos.d/ubi.repo |
| 59 | + echo "cost = 100" >> /etc/yum.repos.d/ubi.repo |
| 60 | + echo "enabled = 1" >> /etc/yum.repos.d/ubi.repo |
| 61 | + echo "gpgcheck = 0" >> /etc/yum.repos.d/ubi.repo |
| 62 | + echo >> /etc/yum.repos.d/ubi.repo |
| 63 | + done |
| 64 | +
|
| 65 | + # Upgrade things |
| 66 | + dnf upgrade -y |
| 67 | +
|
| 68 | + # Now enable EPEL and install git |
| 69 | + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm |
| 70 | + dnf install -y git |
| 71 | + ;; |
| 72 | + esac |
| 73 | +
|
| 74 | +
|
| 75 | + # This means clone the git repo |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + |
| 78 | + # Within the container, install the dependencies, build, |
| 79 | + # and run the test suite |
| 80 | + - name: Build and run the test suite |
| 81 | + run: | |
| 82 | + # Install make(1) so we can use the instreqs target |
| 83 | + dnf install -y make |
| 84 | +
|
| 85 | + # Install build dependencies and set up the target |
| 86 | + make instreqs |
| 87 | +
|
| 88 | + # Build and run the test suite |
| 89 | + make debug |
| 90 | + make check |
| 91 | +
|
| 92 | + # Report coverage |
| 93 | + ninja -C build coverage && ( curl -s https://codecov.io/bash | bash ) || : |
0 commit comments