Skip to content

ci: run ci pipelines also on CentOS 10 #222

ci: run ci pipelines also on CentOS 10

ci: run ci pipelines also on CentOS 10 #222

Workflow file for this run

#
# CI for this project needs to do two things:
# 1. Setup the environment and run `yarn build`
# 2. Build the distribution rpm for use in QE/OST/Integration testing
#
name: run CI on PRs
on:
pull_request:
jobs:
build_offline:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: centos-stream-9
shortcut: cs9
container-name: el9stream
- name: centos-stream-10
shortcut: cs10
container-name: el10stream
name: ${{ matrix.name }} - test, build and publish rpm repo for the PR (ovirt-engine-nodejs-modules build)
container:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}
env:
OFFLINE_BUILD: 1
steps:
- name: Mark git repo as safe
run: git config --global --add safe.directory $(pwd)
- name: Install EPEL (for rpmlint on el10) and rpmlint
run: |
dnf -y install epel-release
dnf -y install rpmlint
- name: Ensure latest ovirt-engine-nodejs-modules is installed
run: |
rpm -q --quiet ovirt-engine-nodejs-modules && ACTION=upgrade || ACTION=install
dnf -y $ACTION ovirt-engine-nodejs-modules
- name: Checkout sources
uses: ovirt/checkout-action@main
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run packaging/build.sh
run: |
./packaging/build.sh
- name: Upload artifacts as rpm repo
uses: ovirt/upload-rpms-action@main
with:
directory: exported-artifacts/
build_online:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: centos-stream-9
shortcut: cs9
container-name: el9stream
- name: centos-stream-10
shortcut: cs10
container-name: el10stream
name: ${{ matrix.name }} - build the project the PR, but skip the rpm builds (online build)
container:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}
env:
OFFLINE_BUILD: 0
MOVE_ARTIFACTS: 0
steps:
- name: Install yarn (online mode does not use ovirt-engine-nodejs-modules so yarn isn't installed)
run: |
dnf -y config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo
dnf -y --disablerepo='*' --enablerepo='yarn*' install yarn
- name: Checkout sources
uses: ovirt/checkout-action@main
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn's work to use in the build job
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./node_modules
key: ${{ github.sha }}
- name: Run 'yarn install' and 'yarn build'
run: |
yarn install
yarn build
# Note: The source tar, srpm and rpm are not needed for the online build. We only
# need 1 rpm repo artifact per distro. The rpm repo is generated from the
# offline build.