Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add Fedora to the CI environment #347

Merged
merged 2 commits into from Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -3,6 +3,42 @@ name: Build Test
on: [push, pull_request]

jobs:
build-fedora-latest:
name: Fedora Latest Stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Create Build Environment
run: cd tests/ci/ && podman build -t appstream -f ./Dockerfile-fedora-latest .

- name: Build
run: podman run -a stdout -a stderr -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build appstream
./tests/ci/run-build.sh

- name: Test
run: podman run -a stdout -a stderr -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build appstream
./tests/ci/run-tests.sh


build-fedora-rawhide:
name: Fedora Rawhide
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Create Build Environment
run: cd tests/ci/ && podman build -t appstream -f ./Dockerfile-fedora-rawhide .

- name: Build
run: podman run -a stdout -a stderr -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build appstream
./tests/ci/run-build.sh

- name: Test
run: podman run -a stdout -a stderr -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build appstream
./tests/ci/run-tests.sh


build-debian-stable:
name: Debian Stable
runs-on: ubuntu-latest
@@ -55,8 +91,26 @@ jobs:
run: CC=gcc CXX=g++ ./tests/ci/run-tests.sh


build-sanitized:
name: Sanitizers
build-sanitized-fedora:
name: Sanitizers on Fedora
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Create Build Environment
run: cd tests/ci/ && podman build -t appstream -f ./Dockerfile-fedora-rawhide .

- name: Build with asan, ubsan
run: podman run -a stdout -a stderr --privileged -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build appstream
./tests/ci/run-build.sh sanitize

- name: Test with asan, ubsan
run: podman run -a stdout -a stderr --privileged -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build appstream
./tests/ci/run-tests.sh sanitize


build-sanitized-debian:
name: Sanitizers on Debian
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -0,0 +1,14 @@
#
# Docker file for AppStream CI tests on Fedora targeting latest stable
#
FROM registry.fedoraproject.org/fedora:latest

# prepare
RUN mkdir -p /build/ci/

# install build dependencies
COPY install-deps-rpm.sh /build/ci/
RUN chmod +x /build/ci/install-deps-rpm.sh && /build/ci/install-deps-rpm.sh

# finish
WORKDIR /build
@@ -0,0 +1,14 @@
#
# Docker file for AppStream CI tests on Fedora Rawhide
#
FROM registry.fedoraproject.org/fedora:rawhide

# prepare
RUN mkdir -p /build/ci/

# install build dependencies
COPY install-deps-rpm.sh /build/ci/
RUN chmod +x /build/ci/install-deps-rpm.sh && /build/ci/install-deps-rpm.sh

# finish
WORKDIR /build
@@ -0,0 +1,44 @@
#!/bin/sh
#
# Install AppStream build dependencies
#
set -e
set -x

# update caches
dnf makecache

# install build dependencies
dnf --assumeyes --quiet --setopt=install_weak_deps=False install \
gcc \
gcc-c++ \
gdb \
meson \
gettext \
gperf \
gtk-doc \
intltool \
itstool \
libasan \
libstemmer-devel \
libubsan \
'pkgconfig(cairo)' \
'pkgconfig(freetype2)' \
'pkgconfig(fontconfig)' \
'pkgconfig(gdk-pixbuf-2.0)' \
'pkgconfig(gio-2.0)' \
'pkgconfig(gobject-introspection-1.0)' \
'pkgconfig(libcurl)' \
'pkgconfig(libsoup-2.4)' \
'pkgconfig(librsvg-2.0)' \
'pkgconfig(libxml-2.0)' \
'pkgconfig(lmdb)' \
'pkgconfig(packagekit-glib2)' \
'pkgconfig(pango)' \
'pkgconfig(protobuf-lite)' \
'pkgconfig(Qt5Core)' \
qt5-linguist \
'pkgconfig(yaml-0.1)' \
sed \
vala \
xmlto
@@ -9,12 +9,20 @@ set -e
#

. /etc/os-release
apt_support=false
build_compose=true
build_docs=false
maintainer_mode=true
if [ "$ID" = "ubuntu" ] && [ "$VERSION_CODENAME" = "focal" ]; then
# we don't make warnings fatal on Ubuntu 20.04
maintainer_mode=false
fi;
if [ "$ID" = "debian" ] || [ "$ID" = "ubuntu" ]; then
# apt support is required for debian(-ish) systems
apt_support=true
# daps is available to build docs
build_docs=true
fi;

build_type=debugoptimized
build_dir="cibuild"
@@ -45,10 +53,10 @@ mkdir $build_dir && cd $build_dir
meson --buildtype=$build_type \
$sanitize_flags \
-Dmaintainer=$maintainer_mode \
-Ddocs=true \
-Ddocs=$build_docs \
-Dqt=true \
-Dcompose=$build_compose \
-Dapt-support=true \
-Dapt-support=$apt_support \
-Dvapi=true \
..

@@ -57,6 +65,8 @@ meson --buildtype=$build_type \
#

ninja
ninja documentation
if [ "$build_docs" = "true" ]; then
ninja documentation
fi
DESTDIR=/tmp/install_root/ ninja install
rm -r /tmp/install_root/