[gtkmm-documentation/ebassi/ci-publish] Add a CI pipeline for building, validating, and publishing




commit d2cf33eb74d0bead3c6189d7743d88e6578b1ebc
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun Aug 1 18:12:38 2021 +0100

    Add a CI pipeline for building, validating, and publishing
    
    We run the build using Meson, split into three stages:
    
     - validation
     - build
     - deployment
    
    The validation phase runs the build with -Dvalidation=true; the build
    phase runs the build with just the HTML generation and without
    translations, for the moment; the deployment phase takes the build
    artifacts and publishes them on the GitLab pages space for the project.

 .gitlab-ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..f1950e2
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,50 @@
+stages:
+  - validate
+  - build
+  - deploy
+
+.build-default:
+  image: "fedora:34"
+  before_script:
+    - export PATH="$HOME/.local/bin:$PATH"
+    - dnf install -y ${FEDORA_DEPS}
+    - pip install --user meson==${MESON_VERSION}
+  script:
+    - meson setup ${MESON_OPTIONS} _build .
+    - meson compile -C _build
+
+docs-validation:
+  extends: .build-default
+  stage: validate
+  variables:
+    FEDORA_DEPS:
+      itstool
+      ninja-build
+      xmllint
+      xsltproc
+    MESON_VERSION: "0.50.0"
+    MESON_OPTIONS: "-Dbuild-examples=false -Dvalidation=true -Dbuild-translations=false -Dbuild-pdf=false"
+
+html-tutorial:
+  extends: .build-default
+  stage: build
+  variables:
+    FEDORA_DEPS:
+      ninja-build
+      xsltproc
+    MESON_VERSION: "0.50.0"
+    MESON_OPTIONS: "-Dbuild-examples=false -Dvalidation=false -Dbuild-translations=false -Dbuild-pdf=false"
+  artifacts:
+    when: always
+    paths:
+      - _build/docs/tutorial
+
+pages:
+  stage: deploy
+  needs: ["html-tutorial"]
+  script:
+    - mkdir public
+    - mv _build/docs/tutorial public
+  only:
+    refs:
+      - master


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]