debian-forge/.github/workflows/tests.yml
David Rheinsberg 9064788fdf ci: add job for documentation build and test
This adds another job to the CI runner. This builds and tests the
documentation. The tests are currently reduced to just verifying the
respective man-pages are actually generated. This can be extended on in
the future.
2020-03-09 13:20:42 +01:00

129 lines
3.1 KiB
YAML

name: Tests
# NOTE(mhayden): Restricting branches prevents jobs from being doubled since
# a push to a pull request triggers two events.
on:
pull_request:
branches:
- "*"
push:
branches:
- master
jobs:
pylint:
name: "pylint"
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.7
steps:
- name: Install pylint
run: pip install pylint==2.4.1
- name: Clone repository
uses: actions/checkout@v2
with:
path: osbuild
- name: Run pylint
run: |
cd osbuild
pylint osbuild runners/* assemblers/* stages/* sources/*
documentation:
name: "📚 Documentation"
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.7
steps:
- name: Install Dependencies
run: |
pip install docutils
- name: Clone repository
uses: actions/checkout@v2
with:
path: osbuild
- name: Generate Documentation
run: |
make \
-f osbuild/Makefile \
SRCDIR=osbuild \
BUILDDIR=build \
RST2MAN=rst2man.py \
man
- name: Verify Documentation
working-directory: build
run: |
test -d docs
test -f docs/osbuild.1
unit_tests:
name: "unit"
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.7
options: --privileged # Needed for bind mounts in unit tests
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
path: osbuild
- name: Run test_osbuild
run: |
cd osbuild
python3 -m unittest -v test.test_osbuild
- name: Run test_objectstore
run: |
cd osbuild
python3 -m unittest -v test.test_objectstore
- name: Run test_osrelease
run: |
cd osbuild
python3 -m unittest -v test.test_osrelease
rpm_build:
name: "📦 RPM"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fedora_release: ["31", "32", "rawhide"]
container:
image: "docker.io/library/fedora:${{ matrix.fedora_release }}"
steps:
- name: "📥 Prepare container"
run: |
echo "fastestmirror=1" >> /etc/dnf/dnf.conf
echo "install_weak_deps=0" >> /etc/dnf/dnf.conf
rm -fv /etc/yum.repos.d/fedora*modular*
dnf -y upgrade
dnf -y install dnf-plugins-core findutils git make rpm-build rpmdevtools
- name: "🗄️ Clone the repository"
uses: actions/checkout@v2
- name: "🛒 Install RPM build dependencies"
run: dnf -y builddep osbuild.spec
- name: "🛠️ Build RPMs"
run: |
mkdir rpms
make srpm
cp -av rpmbuild/SRPMS/*.rpm rpms/
make rpm
cp -av rpmbuild/RPMS/*/*.rpm rpms/
- name: "📤 Upload artifacts"
uses: actions/upload-artifact@v1
with:
name: rpms
path: rpms/
- name: "🔎 Test RPM installation"
run: dnf -y install $(ls rpms/*.noarch.rpm)