-
Notifications
You must be signed in to change notification settings - Fork 185
155 lines (127 loc) · 4.79 KB
/
build-install.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: 'build and installation tests'
on:
pull_request:
branches: ['master']
paths-ignore:
- 'AUTHORS'
- 'COPYING'
- 'NEWS'
- 'README.md'
- 'doc/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rpmbuild:
name: 'rpmbuild test'
needs: unit-ro
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
- 'registry.fedoraproject.org/fedora:39'
- 'registry.fedoraproject.org/fedora:40'
- 'registry.fedoraproject.org/fedora:rawhide'
# OpenSUSE
# leap < 15.2 doesn't contain git-lfs which causes actions/checkout to fail
- 'registry.opensuse.org/opensuse/leap:15.3'
- 'registry.opensuse.org/opensuse/leap:15.4'
- 'registry.opensuse.org/opensuse/leap:15.5'
- 'registry.opensuse.org/opensuse/leap:15.6'
- 'registry.opensuse.org/opensuse/tumbleweed'
# CentOS Stream
- 'quay.io/centos/centos:stream9'
container:
image: ${{ matrix.container }}
steps:
- name: 'Install packages (OpenSUSE)'
if: ${{ contains(matrix.container, '/opensuse/') }}
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
- name: 'Install packages (Fedora/CentOS)'
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
run: |
dnf -y makecache
dnf -y distro-sync
dnf -y install git-lfs rpm-build
rpm -q dnf5 >/dev/null || dnf -y install dnf-plugins-core || :
rpm -q dnf5 >/dev/null && dnf -y install dnf5-plugins || :
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Install build dependencies (OpenSUSE)'
if: ${{ contains(matrix.container, '/opensuse/') }}
run: |
zypper --non-interactive install $(rpmspec -q --buildrequires contrib/osc.spec)
- name: 'Install build dependencies (Fedora/CentOS)'
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
run: |
RHEL_VERSION=$(rpm --eval '%{?rhel}')
[ -n "${RHEL_VERSION}" ] && rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL_VERSION}.noarch.rpm
[ -n "${RHEL_VERSION}" ] && /usr/bin/crb enable
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
- name: 'Install built RPMs (OpenSUSE)'
if: ${{ contains(matrix.container, '/opensuse/') }}
run: |
zypper --non-interactive install --force --allow-vendor-change --allow-unsigned-rpm ./contrib/*/*.rpm
- name: 'Install build RPMs (Fedora/CentOS)'
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
run: |
dnf -y install ./contrib/*/*.rpm
- name: 'Run installed osc'
run: |
osc --help
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
pip3 install .
- name: 'Run installed osc'
run: |
osc --help
virtualenv:
name: 'virtualenv install test'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
steps:
- name: 'Install packages'
run: |
sudo apt-get -y update
sudo apt-get -y --no-install-recommends install git python3-pip python3-rpm python3-virtualenv
- uses: actions/checkout@v3
- name: 'Initialize virtualenv'
run: |
python3 -m venv .env3
source .env3/bin/activate
pip3 install .
- name: 'Run installed osc'
run: |
source .env3/bin/activate
osc --help