C++ Meson Library Project

This commit is contained in:
ktlo
2019-09-05 08:22:25 +00:00
commit 1de134d3f1
25 changed files with 608 additions and 0 deletions

180
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,180 @@
image: reg.handtruth.com/roots/cpp-meson/build:debian
stages:
- setup
- build
- test
- analysis
- package
variables:
GIT_SUBMODULE_STRATEGY: normal
Restore:x86_64-linux-gnu: &restore
stage: setup
variables:
TARGET: x86_64-linux-gnu
script:
- meson -Db_coverage=true build/$TARGET --cross-file=$TARGET
tags: ["default"]
artifacts:
paths:
- build
expire_in: 2 hrs
Restore:arm-linux-gnueabihf:
<<: *restore
variables:
TARGET: arm-linux-gnueabihf
Restore:x86_64-w64-mingw32:
<<: *restore
variables:
TARGET: x86_64-w64-mingw32
Restore:x86_64-alpine-linux-musl:
<<: *restore
image: reg.handtruth.com/roots/cpp-meson/build:alpine
variables:
TARGET: x86_64-alpine-linux-musl
Build:x86_64-linux-gnu: &build
stage: build
variables:
TARGET: x86_64-linux-gnu
script:
- cd build/$TARGET
- ninja
tags: ["default"]
artifacts:
paths:
- build
expire_in: 2 hrs
dependencies:
- Restore:x86_64-linux-gnu
Build:arm-linux-gnueabihf:
<<: *build
variables:
TARGET: arm-linux-gnueabihf
dependencies:
- Restore:arm-linux-gnueabihf
Build:x86_64-alpine-linux-musl:
<<: *build
image: reg.handtruth.com/roots/cpp-meson/build:alpine
variables:
TARGET: x86_64-alpine-linux-musl
dependencies:
- Restore:x86_64-alpine-linux-musl
Build:x86_64-w64-mingw32:
<<: *build
variables:
TARGET: x86_64-w64-mingw32
dependencies:
- Restore:x86_64-w64-mingw32
Test:x86_64-linux-gnu: &test
stage: test
variables:
TARGET: x86_64-linux-gnu
MESON_TESTTHREADS: 1
script:
- cd build/$TARGET
- meson test --wrap='valgrind --error-exitcode=1 --leak-check=full --tool=memcheck --track-origins=yes'
- cat meson-logs/testlog-valgrind.txt
tags: ["default"]
artifacts:
paths:
- build
expire_in: 2 hrs
dependencies:
- Restore:x86_64-linux-gnu
- Build:x86_64-linux-gnu
Test:arm-linux-gnueabihf:
<<: *test
image: reg.handtruth.com/roots/cpp-meson/build:debian-armhf
variables:
TARGET: arm-linux-gnueabihf
tags: ["armhf"]
dependencies:
- Restore:arm-linux-gnueabihf
- Build:arm-linux-gnueabihf
Test:x86_64-alpine-linux-musl:
<<: *test
image: reg.handtruth.com/roots/cpp-meson/build:alpine
variables:
TARGET: x86_64-alpine-linux-musl
dependencies:
- Restore:x86_64-alpine-linux-musl
- Build:x86_64-alpine-linux-musl
Coverage: &coverage
stage: analysis
variables:
TARGET: x86_64-linux-gnu
script:
- cd build/$TARGET
- ninja coverage-text
- cat meson-logs/coverage.txt
coverage: '/^TOTAL\s+\S+\s+\S+\s+(\d+\.?\d+)%/'
tags: ["default"]
artifacts:
paths:
- build
expire_in: 2 hrs
dependencies:
- Restore:x86_64-linux-gnu
- Build:x86_64-linux-gnu
- Test:x86_64-linux-gnu
Check:
stage: analysis
variables:
TARGET: x86_64-linux-gnu
script:
- cd build/$TARGET
- ninja cppcheck
coverage: '/^TOTAL\s+\S+\s+\S+\s+(\d+\.?\d+)%/'
tags: ["default"]
artifacts:
paths:
- build/x86_64-linux-gnu/cppcheck.log
expire_in: 1 week
dependencies:
- Restore:x86_64-linux-gnu
Package:x86_64-linux-gnu: &package
stage: package
variables:
TARGET: x86_64-linux-gnu
script:
- meson -Dprefix=`pwd`/dist/$TARGET -Dbuildtype=release -Doptimization=3 --cross-file=$TARGET package/$TARGET
- cd package/$TARGET
- ninja
- ninja install
tags: ["default"]
artifacts:
paths:
- dist
expire_in: 1 mos
dependencies: []
Package:arm-linux-gnueabihf:
<<: *package
variables:
TARGET: arm-linux-gnueabihf
Package:x86_64-w64-mingw32:
<<: *package
variables:
TARGET: x86_64-w64-mingw32
Package:x86_64-alpine-linux-musl:
<<: *package
image: reg.handtruth.com/roots/cpp-meson/build:alpine
variables:
TARGET: x86_64-alpine-linux-musl