mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 15:14:38 +01:00
And use it to create ratabg-command.py Benefits are that we bypass ratbagd, meaning we can attach gdb or run valgrind on the tools themselves. Problem is the python wrapper doesn't clean up after itself, and so running valgrind is moot Fixes #274 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
243 lines
6.4 KiB
YAML
243 lines
6.4 KiB
YAML
# vim: set expandtab shiftwidth=2 tabstop=8:
|
|
libratbag_references:
|
|
default_settings: &default_settings
|
|
working_directory: ~/libratbag
|
|
environment:
|
|
LANG: C.UTF-8
|
|
build_default: &build_default
|
|
name: Build
|
|
command: |
|
|
rm -rf build
|
|
meson build ${MESON_PARAMS}
|
|
mesonconf build
|
|
ninja -v -C build ${NINJA_ARGS}
|
|
environment:
|
|
MESON_PARAMS: --prefix=/usr
|
|
build_and_test: &build_and_test
|
|
run:
|
|
<<: *build_default
|
|
name: Build and test
|
|
environment:
|
|
NINJA_ARGS: test
|
|
build_with_docs: &build_with_docs
|
|
run:
|
|
<<: *build_default
|
|
name: Build with documentation
|
|
environment:
|
|
MESON_PARAMS: -Ddocumentation=true
|
|
install: &install
|
|
run:
|
|
name: Installing
|
|
command: ninja -C build install
|
|
check_uninstall: &check_uninstall
|
|
run:
|
|
name: Checking if any files are left after uninstall
|
|
command: |
|
|
PREFIX=/root/test_install
|
|
# workaround until https://github.com/mesonbuild/meson/pull/2033 is merged
|
|
# and a new release appears
|
|
git clone https://github.com/whot/meson -b wip/remove-directories-on-uninstall
|
|
./meson/meson.py build_install --prefix=$PREFIX
|
|
ninja -C build_install install
|
|
ninja -C build_install uninstall
|
|
if [ -d $PREFIX ]
|
|
then
|
|
tree $PREFIX
|
|
exit 1
|
|
fi
|
|
export_logs: &export_logs
|
|
store_artifacts:
|
|
path: ~/libratbag/build/meson-logs
|
|
ninja_scan_build: &ninja_scan_build
|
|
run:
|
|
<<: *build_default
|
|
name: Ninja scan-build
|
|
environment:
|
|
NINJA_ARGS: scan-build
|
|
start_dbus: &start_dbus
|
|
run:
|
|
name: Start dbus daemon
|
|
command: |
|
|
mkdir /run/dbus
|
|
/usr/bin/dbus-daemon --system --fork
|
|
|
|
fedora_prep_cache: &fedora_prep_cache
|
|
<<: *default_settings
|
|
steps:
|
|
- run:
|
|
name: Initializing Fedora dnf cache
|
|
command: dnf install -y --downloadonly tree git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel valgrind python3-gobject python3-evdev glib2-devel python3-lxml
|
|
- persist_to_workspace:
|
|
root: /var/cache/
|
|
paths:
|
|
- dnf/*
|
|
|
|
fedora_fetch_cache: &fedora_fetch_cache
|
|
attach_workspace:
|
|
at: /var/cache/
|
|
|
|
fedora_install: &fedora_install
|
|
run:
|
|
name: Install prerequisites
|
|
command: dnf install -y tree git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel valgrind python3-gobject python3-evdev glib2-devel python3-lxml python3-devel swig
|
|
|
|
|
|
fedora_settings: &fedora_settings
|
|
<<: *default_settings
|
|
steps:
|
|
- *fedora_fetch_cache
|
|
- *fedora_install
|
|
- checkout
|
|
- *start_dbus
|
|
- *build_and_test
|
|
- *install
|
|
- *check_uninstall
|
|
- *export_logs
|
|
|
|
|
|
ubuntu_settings: &ubuntu_settings
|
|
<<: *default_settings
|
|
steps:
|
|
- run:
|
|
name: Install prerequisites
|
|
command: |
|
|
apt-get update
|
|
apt-get install -y software-properties-common
|
|
add-apt-repository universe
|
|
apt-get update
|
|
apt-get install -y tree git gcc g++ pkg-config meson check libudev-dev libevdev-dev libsystemd-dev valgrind python3-gi python3-evdev libglib2.0-dev python3-lxml python3-dev swig
|
|
- checkout
|
|
- *start_dbus
|
|
- *build_and_test
|
|
- *install
|
|
- *check_uninstall
|
|
- *export_logs
|
|
|
|
|
|
scan_build_run: &scan_build_run
|
|
<<: *default_settings
|
|
steps:
|
|
- *fedora_fetch_cache
|
|
- *fedora_install
|
|
- run:
|
|
name: Install clang and find
|
|
command: dnf install -y clang-analyzer findutils
|
|
- checkout
|
|
- *ninja_scan_build
|
|
- *export_logs
|
|
- run:
|
|
name: Check scan-build results
|
|
command: test ! -d ~/libratbag/build/meson-logs/scanbuild || test $(find ~/libratbag/build/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 || (echo "Check scan-build results" && false)
|
|
|
|
doc_build: &doc_build
|
|
<<: *default_settings
|
|
steps:
|
|
- *fedora_fetch_cache
|
|
- *fedora_install
|
|
- run:
|
|
name: Install documentation build-deps
|
|
command: dnf install -y python3-sphinx python3-sphinx_rtd_theme doxygen libxslt
|
|
- checkout
|
|
- *build_with_docs
|
|
- *export_logs
|
|
- store_artifacts:
|
|
path: ~/libratbag/build/doc/html
|
|
- persist_to_workspace:
|
|
root: build
|
|
paths:
|
|
- doc/html/*
|
|
|
|
docs_deploy: &docs_deploy
|
|
<<: *default_settings
|
|
steps:
|
|
- *fedora_fetch_cache
|
|
- run:
|
|
name: Install prerequisites
|
|
command: dnf install -y git tree
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: Setup the deploy SSH key
|
|
command: |
|
|
ssh-add -L | tail -n1 > ~/.ssh/deploy.pub
|
|
cat <<EOF > ~/.ssh/config
|
|
Host github.com
|
|
IdentityFile /root/.ssh/deploy.pub
|
|
IdentitiesOnly yes
|
|
EOF
|
|
- run:
|
|
name: Clone doc repository
|
|
command: |
|
|
cd ~
|
|
git clone ssh://git@github.com/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_PROJECT_REPONAME}.github.io
|
|
- run:
|
|
name: Copy the doc, commit and push
|
|
command: |
|
|
set +e
|
|
cd ~/${CIRCLE_PROJECT_REPONAME}.github.io
|
|
\cp -r ~/${CIRCLE_PROJECT_REPONAME}/build/doc/html/* .
|
|
if ! git diff-index --quiet HEAD --; then
|
|
git config --global user.email "libratbag@librabtag.github.io"
|
|
git config --global user.name "The libratbag crew"
|
|
git add .
|
|
git commit -m "update docs from ${CIRCLE_SHA1}"
|
|
git push
|
|
fi
|
|
|
|
version: 2
|
|
jobs:
|
|
fedora_rawhide:
|
|
<<: *fedora_settings
|
|
docker:
|
|
- image: fedora:rawhide
|
|
fedora_cache:
|
|
<<: *fedora_prep_cache
|
|
docker:
|
|
- image: fedora:latest
|
|
fedora_latest:
|
|
<<: *fedora_settings
|
|
docker:
|
|
- image: fedora:latest
|
|
ubuntu_17_04:
|
|
<<: *ubuntu_settings
|
|
docker:
|
|
- image: ubuntu:zesty
|
|
doc_build:
|
|
<<: *doc_build
|
|
docker:
|
|
- image: fedora:latest
|
|
scan_build:
|
|
<<: *scan_build_run
|
|
docker:
|
|
- image: fedora:latest
|
|
doc_deploy:
|
|
<<: *docs_deploy
|
|
docker:
|
|
- image: fedora:latest
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
compile_and_test:
|
|
jobs:
|
|
# - fedora_rawhide
|
|
- fedora_cache
|
|
- scan_build:
|
|
requires:
|
|
- fedora_cache
|
|
- ubuntu_17_04
|
|
- fedora_latest:
|
|
requires:
|
|
- fedora_cache
|
|
- doc_build:
|
|
requires:
|
|
- fedora_cache
|
|
- doc_deploy:
|
|
requires:
|
|
- fedora_cache
|
|
- doc_build
|
|
filters:
|
|
branches:
|
|
only: master
|