[gobject-introspection/ebassi/issue-319: 1/2] ci: Use modern Meson command line
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/ebassi/issue-319: 1/2] ci: Use modern Meson command line
- Date: Wed, 2 Jun 2021 10:39:46 +0000 (UTC)
commit fd7e1869ba7c6e9215d36177178cea957323093c
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Jun 2 11:36:26 2021 +0100
ci: Use modern Meson command line
Don't call Ninja directly, and don't enter the build directory.
Also move shared options to environment variables, so we don't have to
copy and paste them everywhere.
.gitlab-ci.yml | 63 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 33 insertions(+), 30 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4e4572e1..cf027cb0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,31 +8,38 @@ cache:
paths:
- _ccache/
+variables:
+ COMMON_MESON_FLAGS: "--prefix /usr --libdir lib64 --buildtype=debug -Dglib:werror=false -Dcairo=enabled
-Dpython=python3"
+
example-meson:
stage: build
+ variables:
+ EXTRA_MESON_FLAGS: "-Ddoctool=enabled -Dgtk_doc=true"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=enabled -Dgtk_doc=true
-Dcairo=enabled -Dpython=python3 _build .
- - ninja -C _build
- - sudo ninja -C _build install
+ - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build .
+ - meson compile -C _build
+ - meson install -C _build
- g-ir-scanner --version
- cd examples/library
- - meson --prefix /usr --default-library both _build
- - ninja -C _build
- - sudo ninja -C _build install
+ - meson setup --prefix /usr --default-library=both _build .
+ - meson compile -C _build
+ - meson install -C _build
- g-ir-inspect --print-typelibs --print-shlibs GISample
# also build a small program using libgirepository
- cd ../girepository
- - meson _build
- - ninja -C _build
+ - meson setup _build
+ - meson compile -C _build
example-autotools:
stage: build
+ variables:
+ EXTRA_MESON_FLAGS: "-Ddoctool=enabled -Dgtk_doc=true"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=enabled -Dgtk_doc=true
-Dcairo=enabled -Dpython=python3 _build .
- - ninja -C _build
- - sudo ninja -C _build install
+ - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build .
+ - meson compile -C _build
+ - meson install -C _build
- g-ir-scanner --version
- cd examples/library
- ./autogen.sh --prefix /usr
@@ -46,14 +53,13 @@ fedora-x86_64-meson:
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
CCACHE_DIR: "${CI_PROJECT_DIR}/_ccache"
CFLAGS: "-Werror"
+ EXTRA_MESON_FLAGS: "-Ddoctool=enabled -Dgtk_doc=true"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=enabled -Dgtk_doc=true
-Dcairo=enabled -Dpython=python3 _build .
- - cd _build
- - ninja
- - meson test --print-errorlogs --suite=gobject-introspection --no-suite=glib
- - ninja gi-doc
- - cd ..
+ - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build .
+ - meson compile -C _build
+ - meson test -C _build --print-errorlogs --suite=gobject-introspection --no-suite=glib
+ - ninja -C _build gi-doc
- mkdir -p public
- mv _build/docs/reference/html/ public/girepository/
- python3 -m pip install --user flake8 mypy==0.790
@@ -75,10 +81,9 @@ fedora-x86_64-subprojects:
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
CCACHE_DIR: "${CI_PROJECT_DIR}/_ccache"
script:
- - meson _build .
- - cd _build
- - ninja
- - meson test --print-errorlogs --suite=gobject-introspection
+ - meson setup _build .
+ - meson compile -C _build
+ - meson test -C _build --print-errorlogs --suite=gobject-introspection
except:
- tags
artifacts:
@@ -93,13 +98,12 @@ fedora-x86_64-no-introspection-data:
variables:
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
CCACHE_DIR: "${CI_PROJECT_DIR}/_ccache"
- CFLAGS: "-Werror"
+ EXTRA_MESON_FLAGS: "-Dwerror=true"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Dbuild_introspection_data=false
-Dpython=python3 _build .
- - cd _build
- - ninja
- - meson test --print-errorlogs --suite=gobject-introspection --no-suite=glib
+ - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build .
+ - meson compile -C _build
+ - meson test -C _build --print-errorlogs --suite=gobject-introspection --no-suite=glib
except:
- tags
artifacts:
@@ -117,10 +121,9 @@ fedora-x86_64-python3.6:
PYENV_VERSION: "3.6.12"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=enabled -Dgtk_doc=true
-Dcairo=enabled -Dpython=python3 _build .
- - cd _build
- - ninja
- - meson test --print-errorlogs --suite=gobject-introspection --no-suite=glib
+ - meson setup ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _build .
+ - meson compile -C _build
+ - meson test -C _build --print-errorlogs --suite=gobject-introspection --no-suite=glib
except:
- tags
artifacts:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]