ci: Backport CI yaml from main
authorRené de Hesselle <dehesselle@web.de>
Thu, 19 Oct 2023 14:22:54 +0000 (16:22 +0200)
committerRené de Hesselle <dehesselle@web.de>
Thu, 19 Oct 2023 15:11:35 +0000 (17:11 +0200)
This makes the CI yaml identical to the one in main, which changes
two things:
- modernize workflow configuration
- use a new macOS runner for macOS CI

.gitlab-ci.yml

index 5a3332abea2ec3bfc70db8089f8333c571ec1a6a..cffc7a824fb7d8d42e3693c0e69fbfad983ad2c7 100644 (file)
@@ -30,8 +30,16 @@ variables:
 
 workflow:
   rules:
-    - if: $CI_COMMIT_TAG
+    # run merge request pipelines
+    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+    # do not run branch pipelines if corresponding merge requests exist...
+    # (this avoids duplicate pipelines)
+    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
+      when: never
+    # ...but otherwise run branch pipelines
     - if: $CI_COMMIT_BRANCH
+    # run tag pipelines
+    - if: $CI_COMMIT_TAG
 
 default:
   retry:
@@ -197,28 +205,44 @@ msys2-mingw64:
     paths:
       - "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
 
-macos:
-  # Sadly, this fails regularly, and its failure is never enlightening
-  allow_failure: true
+macos-x86_64:
   rules:
+    # Do not run in forks as the runner is not available there.
     - if: $CI_PROJECT_NAMESPACE == "GNOME"
   stage: build
   tags:
-    - macos
+    - macosintel
   needs: []
+  variables:
+    MESON_FORCE_BACKTRACKE: 1
+    TMPDIR: /Users/Shared/work/tmp
+    SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
+    PIP_CACHE_DIR: /Users/Shared/build/cache
+    PIPENV_CACHE_DIR: $PIP_CACHE_DIR
+    PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
+    EXTRA_MESON_FLAGS: "-Dgobject-introspection:werror=false"
   before_script:
+    # Not using ccache on purpose as it accelerates the build so much that it
+    # can trigger race conditions in the gobject-introspection subproject.
     - bash .gitlab-ci/show-info-osx.sh
-    - pip3 install --user meson~=1.0
-    - pip3 install --user ninja
-    - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
-    - export MESON_FORCE_BACKTRACE=1
+    - /opt/macports/bin/python3.10 -m venv .venv
+    - ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin
+    - ln -s /opt/pkg-config/bin/pkg-config .venv/bin
+    - ln -s /opt/bison/bin/bison .venv/bin
+    - source .venv/bin/activate
+    - pip3 install meson==1.2.0
+    - pip3 install ninja==1.11.1
+    - pip3 install /Users/Shared/build/pkgs/PyGObject-3.44.0-cp310-cp310-macosx_10_13_x86_64.whl
+                   /Users/Shared/build/pkgs/pycairo-1.23.0-cp310-cp310-macosx_10_13_x86_64.whl
   script:
-    - meson setup ${COMMON_MESON_FLAGS}
+    - meson setup
+            ${COMMON_MESON_FLAGS}
+            ${EXTRA_MESON_FLAGS}
             -Dx11-backend=false
             -Dbroadway-backend=true
             -Dmacos-backend=true
             -Dmedia-gstreamer=disabled
-            -Dintrospection=disabled
+            -Dintrospection=enabled
             -Dcpp_std=c++11
             -Dpixman:tests=disabled
             -Dlibjpeg-turbo:simd=disabled