Update github actions #483
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Check patch | |
permissions: | |
pull-requests: read | |
contents: read | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-el8: | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/centos/centos:stream8 | |
steps: | |
- name: Prepare env | |
run: | | |
echo ${{ github.base_ref }} | |
echo ${{ github.ref }} | |
mkdir -p ${PWD}/tmp.repos/BUILD | |
dnf distro-sync -y | |
dnf install -y --setopt=tsflags=nodocs autoconf automake gettext-devel git systemd make git rpm-build | |
- uses: ovirt/checkout-action@main | |
with: | |
fetch-depth: 0 | |
- name: Mark git repo as safe | |
run: git config --global --add safe.directory $(pwd) | |
- name: Autoreconf | |
run: autoreconf -ivf | |
- name: Configure | |
run: ./configure | |
- name: Run distcheck | |
run: make -j distcheck | |
- name: Build RPM | |
run: | | |
mkdir -p ${PWD}/tmp.repos/SOURCES | |
cp ovirt-release*.tar.gz ${PWD}/tmp.repos/SOURCES/ | |
SUFFIX=$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD) | |
rpmbuild -D "_topdir ${PWD}/tmp.repos" -D "release_suffix .${SUFFIX}" -ba ovirt-release-master.spec | |
rpmbuild -D "_topdir ${PWD}/tmp.repos" -D "release_suffix .${SUFFIX}" -ba ovirt-release-host-node.spec | |
- name: Collect artifacts | |
run: | | |
mkdir -p exported-artifacts | |
find tmp.repos -iname \*rpm -exec mv "{}" exported-artifacts/ \; | |
mv ./*tar.gz exported-artifacts/ | |
- name: Install master built rpm | |
# On master the release rpm is named ovirt-release-master | |
# The build produce also other packages like ovirt-release-host-node | |
# which require the repos to be enabled by the ovirt-release-master package | |
# in order to be installable. | |
run: | | |
dnf install -y exported-artifacts/ovirt-release-master-4*noarch.rpm | |
- name: Test project installation | |
run: | | |
dnf module enable -y javapackages-tools:201801 | |
dnf module enable -y maven:3.5 | |
dnf module enable -y pki-deps:10.6 | |
dnf module enable -y postgresql:12 | |
dnf module enable -y mod_auth_openidc:2.3 | |
dnf --downloadonly install -y exported-artifacts/*noarch.rpm exported-artifacts/*x86_64.rpm | |
dnf --downloadonly install -y ovirt-engine ovirt-engine-setup-plugin-websocket-proxy | |
dnf --downloadonly install -y ovirt-engine-appliance | |
- name: Upload artifacts | |
uses: ovirt/upload-rpms-action@main | |
with: | |
directory: exported-artifacts | |
build-el9: | |
# Building only on master as we don't support el9 in 4.4. | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/centos/centos:stream9 | |
if: contains(github.base_ref, 'master') || contains(github.ref, 'master') | |
steps: | |
- name: Prepare env | |
run: | | |
mkdir -p ${PWD}/tmp.repos/BUILD | |
dnf distro-sync -y | |
dnf install -y --setopt=tsflags=nodocs autoconf automake gettext-devel git systemd make git rpm-build | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Mark git repo as safe | |
run: git config --global --add safe.directory $(pwd) | |
- name: Autoreconf | |
run: autoreconf -ivf | |
- name: Configure | |
run: ./configure | |
- name: Run distcheck | |
run: make -j distcheck | |
- name: Build RPM | |
run: | | |
mkdir -p ${PWD}/tmp.repos/SOURCES | |
cp ovirt-release*.tar.gz ${PWD}/tmp.repos/SOURCES | |
SUFFIX=$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD) | |
rpmbuild -D "_topdir ${PWD}/tmp.repos" -D "release_suffix .${SUFFIX}" -ba ovirt-release-master.spec | |
rpmbuild -D "_topdir ${PWD}/tmp.repos" -D "release_suffix .${SUFFIX}" -ba ovirt-release-host-node.spec | |
- name: Collect artifacts | |
run: | | |
mkdir -p exported-artifacts | |
find tmp.repos -iname \*rpm -exec mv "{}" exported-artifacts/ \; | |
mv ./*tar.gz exported-artifacts/ | |
- name: Test install | |
run: | | |
dnf install -y exported-artifacts/ovirt-release-master-4*noarch.rpm | |
dnf --downloadonly install -y exported-artifacts/*noarch.rpm exported-artifacts/*x86_64.rpm | |
- name: Upload artifacts | |
uses: ovirt/upload-rpms-action@main | |
with: | |
directory: exported-artifacts |