-
Notifications
You must be signed in to change notification settings - Fork 23
136 lines (131 loc) · 4.08 KB
/
tests.yml
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
name: tests
on: [push, pull_request]
jobs:
tox27:
runs-on: ubuntu-latest
container:
image: registry.access.redhat.com/rhel7:latest
steps:
- uses: actions/checkout@v3
- name: Add CentOS Yum repos
run: |
cat <<EOF > /etc/yum.repos.d/centos.repo
[base]
name=CentOS-7 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=\$basearch&repo=os
baseurl=http://mirror.centos.org/centos/7/os/\$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-7 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=\$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/7/updates/\$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
EOF
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- name: Add minimal setup.py for old tox
# Tox 1.4.2 in EPEL 7 does not support the skipsdist option
run: |
cat <<EOF > setup.py
from setuptools import setup, find_packages
setup(
name='koji-ansible',
version='0.0.0',
author='Ken Dreyer',
author_email='[email protected]',
packages=find_packages(),
include_package_data=True,
)
EOF
- name: Install dependencies
run: |
yum --setopt=skip_missing_names_on_install=False -y install krb5-devel python2-devel python2-pip python-tox git-core gcc
- name: Test with tox
run: |
tox -e py27 -- tests
tox:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
include:
- python-version: 3.6
os: ubuntu-20.04
- python-version: 3.9
os: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libkrb5-dev
pip install tox
- name: Test with tox
run: |
PY=py$(echo ${{ matrix.python-version }} | tr -d ".")
tox -e ${PY} -- --cov-report=xml tests
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
fail_ci_if_error: false
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
ansible:
- ga
- pre
steps:
- uses: actions/checkout@v3
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install \
apache2 \
libapache2-mod-wsgi-py3 \
postgresql \
python3-cryptography \
python3-dateutil \
python3-pip \
python3-psycopg2 \
python3-requests \
python3-rpm \
python3-setuptools \
python3-six
- name: Install Ansible
env:
ANSIBLE: ${{ matrix.ansible }}
run: |
sudo apt-get purge ansible
if [ "$ANSIBLE" = ga ] ; then
PIP_IGNORE_INSTALLED=0 pip3 install ansible --user
else
PIP_IGNORE_INSTALLED=0 pip3 install ansible --user --pre
fi
- name: Set up test environment
run: tests/integration/setup.sh
- name: Run integration tests
run: tests/integration/run.sh
test-collection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch base branches for version calculation
run: |
git fetch origin master:master || :
[ -z $GITHUB_BASE_REF ] || git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF
- uses: actions/setup-python@v4
- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install pandoc
- name: Test collection build
run: tests/integration/collection.sh