From 3eb93dfd7e2b61649a9ea6b07270cef829b03eee Mon Sep 17 00:00:00 2001 From: Vasily Galkin Date: Fri, 21 Feb 2020 00:09:18 +0000 Subject: [PATCH 1/3] win32, gitlab-ci: run windows build in parallel with flatpak To speedup pipeline as a whole the windows builds and flatpak builds are put in the same stage. Conceptually the are similar - creating plaform-specific packages, and both takes near 2 minutes Also the extending syntax updated to "extends:" gitlab feature. --- .gitlab-ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8515e18f..2a13bb83 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,7 @@ image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master stages: - check - test - - build-flatpak - - build-windows + - build - deploy variables: @@ -22,7 +21,7 @@ variables: flatpak: extends: .flatpak - stage: build-flatpak + stage: build variables: MANIFEST_PATH: "data/org.gnome.MeldDevel.json" MESON_ARGS: "-Dprofile=Devel" @@ -50,8 +49,8 @@ pytest: script: - py.test-3 test/ -.mingw-common: &mingw-common - stage: build-windows +.mingw-common: + stage: build tags: # select gitlab runners with specific tag (unrelated to git repo tags) - win32 artifacts: @@ -69,13 +68,13 @@ pytest: allow_failure: true mingw64-dist: + extends: .mingw-common variables: MSYS2_ARCH: x86_64 MSYSTEM: MINGW64 - <<: *mingw-common mingw32-dist: + extends: .mingw-common variables: MSYS2_ARCH: i686 MSYSTEM: "MINGW32" - <<: *mingw-common -- GitLab From f5221a4ad78a9f5fec2b2f47c3c68e85a92e7dc5 Mon Sep 17 00:00:00 2001 From: Vasily Galkin Date: Fri, 21 Feb 2020 03:41:49 +0300 Subject: [PATCH 2/3] gitlab-ci: run checks in flatpak environment This restores CI to green without switching to another docker image. The registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master image disabled root access, so using dnf failed. All our non-dev dependencies are present in org.gnome.Sdk flatpak and all dev dependencies are python only. So using on org.gnome.Sdk flatpak + pip3 --user is a technically valid option that allows to continue using the same runtime image without mantaining meld-specific docker images or using images requering manual install of gnome deps. Also not using dnf at every ci build speeds up the check process. --- .gitlab-ci.yml | 22 ++++++++++++---------- dev-requirements.txt | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a13bb83..c98264dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,20 +34,22 @@ nightly: dependencies: - 'flatpak' -lint: +.pythonchecks: stage: check + tags: # test in the same org.gnome.Sdk environment that is used for creating flatpaks + - flatpak script: - - dnf install -y git - - pip3 install -r dev-requirements.txt - - pre-commit run --all-files --show-diff-on-failure + - flatpak run --share=network --filesystem=`pwd` --env=PATH=$PATH:/var/data/python/bin --command=sh org.gnome.Sdk -c 'pip3 install --user -r dev-requirements.txt; $PYTHON_CHECK_COMMAND' + +lint: + extends: .pythonchecks + variables: + PYTHON_CHECK_COMMAND: "pre-commit run --all-files --show-diff-on-failure" pytest: - stage: check - before_script: - - dnf update -y - - dnf install -y $DEPENDENCIES - script: - - py.test-3 test/ + extends: .pythonchecks + variables: + PYTHON_CHECK_COMMAND: "pytest" .mingw-common: stage: build diff --git a/dev-requirements.txt b/dev-requirements.txt index 166923de..4ef1e4af 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,3 +5,4 @@ pep8-naming==0.4.1 pre-commit==1.18.3 pycodestyle==2.5.0 pyflakes==2.1.0 +pytest==5.3.5 -- GitLab From 10e2fb360b6607cfd1fffcd7832554f36e708b01 Mon Sep 17 00:00:00 2001 From: Vasily Galkin Date: Fri, 21 Feb 2020 13:09:26 +0000 Subject: [PATCH 3/3] DEPENDENCIES variable unused after swithing to flatpak --- .gitlab-ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c98264dd..abc76e50 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,14 +10,6 @@ stages: variables: BUNDLE: "meld-dev.flatpak" - DEPENDENCIES: python3 - python3-pip - python3-pytest - python3-gobject - gobject-introspection - gtk3 - gtksourceview4 - glib2-devel flatpak: extends: .flatpak -- GitLab