From 467d96c03d5b0c2eab6f10b82c9e04d04b02c4a4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 14 Aug 2022 16:57:46 +0200 Subject: [PATCH] Add a Fedora CI build using Circle CI This is a backport of the following commits from master: 934aa20d69 Build and run tests on Circle CI too 9f1bf3982d Install RPM required for Shift-JIS support in Fedora 64aefb5f4e Install locales used by the tests under Fedora 84120664ca Make Circe CI script more consistent with Cirrus CI bf3951866c Install Git before checking out the sources 3eb78a328e Use ccache in Circle CI job e63fe497ab Install more optional libraries under Fedora a527b2714d Allow installing extra packages in before_install.sh b430a6104c Add a minimal Fedora build using Circle CI 382db6439b Install required packages on RedHat-like systems --- .circleci/config.yml | 81 +++++++++++++++++++++++++++++++++++ .cirrus.yml | 3 +- build/tools/before_install.sh | 16 +++++-- 3 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..e7a5af4677 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,81 @@ +# Config file for CI jobs on CircleCI (circleci.com). +version: 2.1 + +jobs: + build-fedora: + docker: + - image: fedora + steps: + - run: + name: Install Git + command: dnf install -y git + + - checkout + + - run: + name: Install dependencies + command: | + echo LD_LIBRARY_PATH=`pwd`/lib >> $BASH_ENV + + # Do _not_ use the CPU count returned by build/tools/proc_count.sh + # for building, it is too high (36 logical CPUs) and results in + # running out of memory, so limit ourselves to just 2 CPUs we're + # supposed to be using in Docker Medium resource class. + wxPROC_COUNT=2 + echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $BASH_ENV + + # Get extra conversions for iconv used by the tests and langpacks + # to run the tests using the corresponding locales that would be + # skipped otherwise. + export WX_EXTRA_PACKAGES='ccache glibc-gconv-extra langpacks-core-de langpacks-core-en langpacks-core-fr langpacks-core-sv' + ./build/tools/before_install.sh + + echo "PATH=/usr/lib64/ccache:$PATH" >> $BASH_ENV + + - run: + name: Checkout required submodules + command: | + git submodule update --init 3rdparty/catch 3rdparty/nanosvg + + - restore_cache: + name: Restore ccache + keys: + - ccache-v1-{{ arch }}-{{ .Branch }} + - ccache-v1-{{ arch }} + + - run: + name: Configure + command: ./configure --disable-debug-info + + - run: + name: Build libraries + command: | + make -k $wxBUILD_ARGS CXXFLAGS='-Werror -Wno-error=cpp' + + - run: + name: Build tests + command: | + make -k $wxBUILD_ARGS CXXFLAGS='-Werror -Wno-error=cpp' -C tests + + - run: + name: Run tests + command: | + cd tests + WX_TEST_WEBREQUEST_URL="0" ./test + + - run: + name: Show ccache statistics + when: always + command: ccache -vv -s + + - save_cache: + name: Save ccache + when: always + key: ccache-v1-{{ arch }}-{{ .Branch }}-{{ .BuildNum }} + paths: + - ~/.cache/ccache + +workflows: + build: + jobs: + - build-fedora diff --git a/.cirrus.yml b/.cirrus.yml index 97b2bf3b6b..720cb87488 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -19,9 +19,8 @@ task: wxPROC_COUNT=`./build/tools/proc_count.sh` echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $CIRRUS_ENV - ./build/tools/before_install.sh + WX_EXTRA_PACKAGES='ccache git' ./build/tools/before_install.sh - pkg install -q -y ccache git echo "PATH=/usr/local/libexec/ccache:$PATH" >> $CIRRUS_ENV # Rather than getting all submodules, get just the ones we need, as we can diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index e9e445acd2..92d95cadfd 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -1,8 +1,11 @@ #!/bin/sh # -# This script is used by GitHub to install the dependencies +# This script is used by CI jobs to install the dependencies # before building wxWidgets but can also be run by hand if necessary (but -# currently it only works for Ubuntu versions used by the CI builds). +# currently it only works for the OS versions used by the CI builds). +# +# WX_EXTRA_PACKAGES environment variable may be predefined to contain extra +# packages to install (in an OS-specific way) in addition to the required ones. set -e @@ -10,6 +13,7 @@ SUDO=sudo case $(uname -s) in Linux) + # Debian/Ubuntu if [ -f /etc/apt/sources.list ]; then # Show information about the repositories and priorities used. echo 'APT sources used:' @@ -81,7 +85,7 @@ case $(uname -s) in libglu1-mesa-dev" esac - pkg_install="$pkg_install $libtoolkit_dev gdb" + pkg_install="$pkg_install $libtoolkit_dev gdb ${WX_EXTRA_PACKAGES}" extra_deps="$extra_deps libcurl4-openssl-dev libsecret-1-dev libnotify-dev" for pkg in $extra_deps; do @@ -107,10 +111,14 @@ case $(uname -s) in touch wx_dbgsym_available fi fi + + if [ -f /etc/redhat-release ]; then + dnf install -y ${WX_EXTRA_PACKAGES} expat-devel findutils g++ git-core gspell-devel gstreamer1-plugins-base-devel gtk3-devel make libcurl-devel libGLU-devel libjpeg-devel libnotify-devel libpng-devel libSM-devel libsecret-devel libtiff-devel SDL-devel webkit2gtk3-devel zlib-devel + fi ;; FreeBSD) - pkg install -q -y gspell gstreamer1 gtk3 jpeg-turbo libnotify libsecret mesa-libs pkgconf png tiff webkit2-gtk3 + pkg install -q -y ${WX_EXTRA_PACKAGES} gspell gstreamer1 gtk3 jpeg-turbo libnotify libsecret mesa-libs pkgconf png tiff webkit2-gtk3 ;; Darwin)