1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-15 08:36:13 +01:00
github.com_openSUSE_osc/.github/workflows/build-install.yaml

122 lines
3.6 KiB
YAML
Raw Normal View History

2022-08-24 10:27:52 +02:00
name: 'build and installation tests'
2022-08-11 20:35:27 +02:00
on:
pull_request:
branches: ['master']
paths-ignore:
- 'AUTHORS'
- 'COPYING'
- 'NEWS'
- 'README.md'
- 'doc/**'
2022-08-11 20:35:27 +02:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
2022-08-11 20:35:27 +02:00
jobs:
2022-08-24 10:27:52 +02:00
rpmbuild:
2022-08-11 20:35:27 +02:00
name: 'rpmbuild test'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
# Testing per python-version using actions/setup-python is not possible,
# because rpm doesn't exist on pypi and cannot be installed via pip on ubuntu.
# That's why we're going to test on the target distros directly.
container:
# Fedora
2023-06-01 13:37:27 +02:00
- 'registry.fedoraproject.org/fedora:36'
- 'registry.fedoraproject.org/fedora:rawhide'
2022-08-11 20:35:27 +02:00
# OpenSUSE
# leap < 15.2 doesn't contain git-lfs which causes actions/checkout to fail
2023-06-01 13:37:27 +02:00
- 'registry.opensuse.org/opensuse/leap:15.3'
- 'registry.opensuse.org/opensuse/leap:15.4'
- 'registry.opensuse.org/opensuse/tumbleweed'
2022-08-11 20:35:27 +02:00
# CentOS Stream
- 'quay.io/centos/centos:stream9'
container:
image: ${{ matrix.container }}
steps:
- name: 'Install packages (OpenSUSE)'
2023-06-01 13:37:27 +02:00
if: ${{ contains(matrix.container, '/opensuse/') }}
2022-08-11 20:35:27 +02:00
run: |
zypper -n modifyrepo --disable repo-openh264 || :
zypper -n --gpg-auto-import-keys refresh
zypper -n lr --details
zypper -n dist-upgrade
zypper -n install git-lfs rpm-build
2022-08-11 20:35:27 +02:00
- name: 'Install packages (Fedora/CentOS)'
2023-06-01 13:37:27 +02:00
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
2022-08-11 20:35:27 +02:00
run: |
dnf -y makecache
dnf -y distro-sync
dnf -y install git-lfs rpm-build dnf-plugins-core
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Install build dependencies (OpenSUSE)'
2023-06-01 13:37:27 +02:00
if: ${{ contains(matrix.container, '/opensuse/') }}
2022-08-11 20:35:27 +02:00
run: |
zypper --non-interactive install $(rpmspec -q --buildrequires contrib/osc.spec)
- name: 'Install build dependencies (Fedora/CentOS)'
2023-06-01 13:37:27 +02:00
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
2022-08-11 20:35:27 +02:00
run: |
dnf -y builddep contrib/osc.spec
- name: 'Build SRPM and RPMs'
run: |
git config --global --add safe.directory "$(pwd)"
git remote add upstream https://github.com/openSUSE/osc.git
git fetch upstream --tags --force
./contrib/build_rpm.py --srpm --rpm
2022-08-24 10:27:52 +02:00
2022-10-20 09:14:03 +02:00
- name: 'Install built RPMs (OpenSUSE)'
2023-06-01 13:37:27 +02:00
if: ${{ contains(matrix.container, '/opensuse/') }}
2022-10-20 09:14:03 +02:00
run: |
zypper --non-interactive install --force --allow-vendor-change --allow-unsigned-rpm ./contrib/*/*.rpm
- name: 'Install build RPMs (Fedora/CentOS)'
2023-06-01 13:37:27 +02:00
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
2022-10-20 09:14:03 +02:00
run: |
dnf -y install ./contrib/*/*.rpm
- name: 'Run installed osc'
run: |
osc --help
2022-08-24 10:27:52 +02:00
pip:
name: 'pip install test'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
steps:
- name: 'Install packages'
run: |
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y --no-install-recommends install git python3-pip python3-rpm
- uses: actions/checkout@v3
- name: 'Install osc from pip'
run: |
pip config set global.break-system-packages 1
2022-08-24 10:27:52 +02:00
pip3 install .
2022-10-20 09:14:03 +02:00
- name: 'Run installed osc'
run: |
osc --help