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
This commit is contained in:
Vadim Zeitlin 2022-08-14 16:57:46 +02:00
parent a6d05742ac
commit 467d96c03d
3 changed files with 94 additions and 6 deletions

81
.circleci/config.yml Normal file
View File

@ -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

View File

@ -19,9 +19,8 @@ task:
wxPROC_COUNT=`./build/tools/proc_count.sh` wxPROC_COUNT=`./build/tools/proc_count.sh`
echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $CIRRUS_ENV 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 echo "PATH=/usr/local/libexec/ccache:$PATH" >> $CIRRUS_ENV
# Rather than getting all submodules, get just the ones we need, as we can # Rather than getting all submodules, get just the ones we need, as we can

View File

@ -1,8 +1,11 @@
#!/bin/sh #!/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 # 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 set -e
@ -10,6 +13,7 @@ SUDO=sudo
case $(uname -s) in case $(uname -s) in
Linux) Linux)
# Debian/Ubuntu
if [ -f /etc/apt/sources.list ]; then if [ -f /etc/apt/sources.list ]; then
# Show information about the repositories and priorities used. # Show information about the repositories and priorities used.
echo 'APT sources used:' echo 'APT sources used:'
@ -81,7 +85,7 @@ case $(uname -s) in
libglu1-mesa-dev" libglu1-mesa-dev"
esac 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" extra_deps="$extra_deps libcurl4-openssl-dev libsecret-1-dev libnotify-dev"
for pkg in $extra_deps; do for pkg in $extra_deps; do
@ -107,10 +111,14 @@ case $(uname -s) in
touch wx_dbgsym_available touch wx_dbgsym_available
fi fi
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) 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) Darwin)