[pitivi/thiblahute/pre_commit_ci: 5/5] x




commit 40612135db7db6ec7de1261ae924efd9f6532d83
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Thu Jan 14 09:36:39 2021 +0100

    x

 .gitlab-ci.yml | 49 ++++++++++++++++++++++---------------------------
 1 file changed, 22 insertions(+), 27 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dffe6c970..087ccfe6d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,7 +5,7 @@ stages:
   - deploy
 
 variables:
-  MANIFEST: build/flatpak/org.pitivi.Pitivi.json
+  MANIFEST: /build/pitivi/build/flatpak/org.pitivi.Pitivi.json
   DBUS_ID: org.pitivi.Pitivi
   XUNIT_PATH: ${CI_PROJECT_DIR}/xunit.xml
   GST_DEBUG_NO_COLOR: "true"
@@ -27,13 +27,16 @@ pitivi:master:
     - export IMAGE="${CI_REGISTRY}/${NAMESPACE}/${CI_PROJECT_NAME}:master-sdk_3.38"
     - export BASE_IMAGE="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38"
     - export TMPIMAGENAME="tmp-pitivi-master-sdk_3.38"
-    - export BUILDDIR="\${HOME}/pitivi"
-    - export CLONE_PITIVI="git clone ${CI_PROJECT_URL}.git --single-branch \${HOME}/pitivi -b 
${CI_COMMIT_REF_NAME}"
-    - export BUILD_PITIVI="flatpak-builder --user --disable-rofiles-fuse ${BUILDDIR}/app 
${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache"
+
+    - export CLONE_PITIVI="git clone ${CI_PROJECT_URL}.git --single-branch /build/pitivi -b 
${CI_COMMIT_REF_NAME}"
+    # All the downloads, build dirs, build cache, etc. are stored in /build/flatpak-cache.
+    - export BUILD_PITIVI="flatpak-builder --user --disable-rofiles-fuse /build/pitivi/app ${MANIFEST} 
--state-dir=/build/flatpak-cache --ccache"
+    # Run pre-commit to download and cache the hooks.
+    - export PRE_COMMIT="flatpak-builder --disable-rofiles-fuse --filesystem=/build/pitivi 
--env=PRE_COMMIT_HOME=/build/pre-commit-home --run /build/pitivi/app ${MANIFEST} pre-commit install-hooks"
 
     - env
 
-    - docker run --privileged --name ${TMPIMAGENAME} ${BASE_IMAGE} bash -c "${CLONE_PITIVI} && 
${BUILD_PITIVI} && rm -Rf ${BUILDDIR}"
+    - docker run --privileged --name ${TMPIMAGENAME} ${BASE_IMAGE} bash -c "${CLONE_PITIVI} && 
${BUILD_PITIVI} && rm -Rf /build/pitivi && ${PRE_COMMIT}"
     - docker commit ${TMPIMAGENAME} ${IMAGE}
     - docker rm ${TMPIMAGENAME}
     - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
@@ -49,34 +52,27 @@ build:
   tags:
     - flatpak
   image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.38
-  variables:
-    BLACKLIST: >
-      -b tests.test_effects.EffectsPropertiesManagerTest.test_dependent_properties
   script:
-    - export BUILDDIR=${HOME}/pitivi
-    - export MANIFEST=${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json
-    - export RUN_IN_SANDBOX="flatpak-builder --disable-rofiles-fuse --filesystem=${BUILDDIR} 
--filesystem=${CI_PROJECT_DIR} --env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --env=GST_DEBUG_NO_COLOR=true 
--run app ${MANIFEST}"
-    - export FLATPAK_BUILDER_CACHE="--state-dir=${HOME}/flatpak-cache"
-    - export FLATPAK_REPO="${CI_PROJECT_DIR}/flatpak_repo"
+    - export RUN_IN_SANDBOX="flatpak-builder --disable-rofiles-fuse --filesystem=/build/pitivi 
--filesystem=${CI_PROJECT_DIR} --env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --env=GST_DEBUG_NO_COLOR=true 
--env=PRE_COMMIT_HOME=/build/pre-commit-home --run /build/pitivi/app ${MANIFEST}"
 
     - env
 
-    # Working around the fact that flatpak-builder *requires* the cache dir
-    # to be on the same filesystem as the build dir
-    - mv ${CI_PROJECT_DIR} ${BUILDDIR}
+    # flatpak-builder *requires* the cache dir to be on the same filesystem as the build dir.
+    # The cache dir is in /build/flatpak-cache.
+    # The build dir is in /builds/GNOME/pitivi/flatpak_repo
+    #
+    # Moving the git repo from /builds/GNOME/pitivi to /build/pitivi so that
+    # it's on the same filesystem as the flatpak-builder cache in
+    # /build/flatpak-cache.
+    - mv ${CI_PROJECT_DIR} /build/pitivi
     - mkdir -p ${CI_PROJECT_DIR}
 
-    - cd ${BUILDDIR}
-    - flatpak-builder --user --disable-rofiles-fuse ${FLATPAK_BUILDER_CACHE} --disable-download --ccache 
--repo=${FLATPAK_REPO} --force-clean app build/flatpak/org.pitivi.Pitivi.json --subject="Rolling update for 
pitivi master" --body="See ${CI_JOB_URL}"
+    - cd /build/pitivi
+    - flatpak-builder --user --disable-rofiles-fuse --state-dir=/build/flatpak-cache --disable-download 
--ccache --repo=${CI_PROJECT_DIR}/flatpak_repo --force-clean app build/flatpak/org.pitivi.Pitivi.json 
--subject="Rolling update for pitivi master" --body="See ${CI_JOB_URL}"
     - ${RUN_IN_SANDBOX} meson mesonbuild/
     - ${RUN_IN_SANDBOX} ninja -C mesonbuild/
     - ${RUN_IN_SANDBOX} pre-commit run --all-files
-    - xvfb-run -n 32 -s "-screen 0 640x480x24" ${RUN_IN_SANDBOX} gst-validate-launcher 
$PWD/tests/ptv_testsuite.py --dump-on-failure --timeout-factor 4 --xunit-file ${XUNIT_PATH} 
--logs-dir=${CI_PROJECT_DIR}/tests-logs ${BLACKLIST}
-
-    # For some reason GitLab fails to upload directories
-    - cd ${CI_PROJECT_DIR}/
-    - tar czf tests-logs.tar.gz tests-logs/
-    - tar cf flatpak_repo.tar flatpak_repo/
+    - xvfb-run -n 32 -s "-screen 0 640x480x24" ${RUN_IN_SANDBOX} gst-validate-launcher 
$PWD/tests/ptv_testsuite.py --dump-on-failure --timeout-factor 4 --xunit-file ${XUNIT_PATH} 
--logs-dir=${CI_PROJECT_DIR}/tests-logs
   cache:
     paths:
       - flatpak-cache
@@ -84,8 +80,8 @@ build:
     expire_in: 30 days
     paths:
       - xunit.xml
-      - flatpak_repo.tar
-      - tests-logs.tar.gz
+      - repo/
+      - tests-logs/
     reports:
       junit:
         - ${XUNIT_PATH}
@@ -96,7 +92,6 @@ deploy:
     - PitiviBuildMachine
   stage: deploy
   script:
-    - tar xf flatpak_repo.tar
     - flatpak build-commit-from --src-repo=flatpak_repo /srv/http --timestamp=NOW --gpg-sign=739E841A
   only:
     - master@GNOME/pitivi


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