[PATCH i-g-t] .gitlab-ci: Add explaination to run CI locally
Kamil Konieczny
kamil.konieczny at linux.intel.com
Wed Apr 30 12:31:34 UTC 2025
Hi Louis,
On 2024-07-10 at 15:22:12 +0200, Louis Chauvet wrote:
Sorry for late response, see my comments below.
> Currently, the CI can only be run on the mailing list. To avoid flooding
> because of error in certain configurations, add a new .gitlab-ci-local.yml
> file and some explanation to run some part of the CI locally.
>
> Added some instruction in CONTRIBUTING.md to explain how to use this new
> pipeline locally.
>
+cc Ryszard
Cc: Ryszard Knop <ryszard.knop at linux.intel.com>
also +cc Vitaly
Cc: Vitaly Prosyak <vitaly.prosyak at amd.com>
> ---
> The "normal" .gitlab-ci.yml can't be used as it uses prebuild docker
> images, only available for gitlab runners.
>
> I did not include any debian build as I was not able to rebuild the docker
> images.
> ---
> .gitlab-ci-local.yml | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++
Could you add this as a bash script which will create this file after running it?
script/gitlab-ci-local.sh --> after run create .gitlab-ci-local.yml
Also add .gitlab-ci-local.yml to .gitignore
> CONTRIBUTING.md | 16 +++++++++
> 2 files changed, 115 insertions(+)
>
> diff --git a/.gitlab-ci-local.yml b/.gitlab-ci-local.yml
> new file mode 100644
> index 000000000000..21d4468379c8
> --- /dev/null
> +++ b/.gitlab-ci-local.yml
> @@ -0,0 +1,99 @@
> +image: igt-build-fedora
> +variables:
> + BUILDAH_FORMAT: docker
> + BUILDAH_ISOLATION: chroot
> + MESON_OPTIONS: >
> + -Dlibdrm_drivers=intel,nouveau,amdgpu
> + -Doverlay=enabled
> + -Dchamelium=enabled
> + -Dvalgrind=enabled
> + -Dman=enabled
> + -Dtests=enabled
> + -Drunner=enabled
> + -Dlibunwind=enabled
> + LANG: "C.UTF-8"
> +
> +stages:
> + - build
> + - test
> +
> +#################### BUILD #########################
> +
> +build:tests-fedora:
> + stage: build
> + script:
> + - meson --prefix=/opt/igt $MESON_OPTIONS build
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
> + - DESTDIR="$PWD/installdir" ninja -C build install
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} igt-gpu-tools-doc
> + artifacts:
> + paths:
> + - build
> + - installdir
> +
> +build:tests-fedora-no-libunwind:
> + stage: build
> + script:
> + - dnf remove -y libunwind-devel
> + - meson -Dlibunwind=disabled build
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
> +
> +# documentation building is different with meson<0.47
> +build:tests-fedora-oldest-meson:
> + stage: build
> + script:
> + - dnf remove -y meson
> + - pip install /usr/src/meson-*.tar.gz
> + - meson $MESON_OPTIONS build
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} igt-gpu-tools-doc
> +
> +# ensure igt_nouveau stubs build when nouveau support for libdrm is disabled
> +build:tests-fedora-no-libdrm-nouveau:
> + stage: build
> + script:
> + - meson -Dlibdrm_drivers= build
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
> +
> +build:tests-fedora-clang:
> + stage: build
> + variables:
> + CC: clang
> + script:
> + - meson $MESON_OPTIONS build
> + - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
> + artifacts:
> + paths:
> + - build
> +
> +
> +test:ninja-test:
> + retry: 2
> + dependencies:
> + - build:tests-fedora
> + stage: test
> + script: meson test -C build --num-processes ${FDO_CI_CONCURRENT:-4}
> +
> +test:ninja-test-clang:
> + retry: 2
> + dependencies:
> + - build:tests-fedora-clang
> + variables:
> + CC: clang
> + stage: test
> + script: meson test -C build --num-processes ${FDO_CI_CONCURRENT:-4}
> +
> +test:list-undocumented-tests:
> + dependencies:
> + - build:tests-fedora
> + stage: test
> + script: .gitlab-ci/list_undocumented_tests.py build/tests/test-list.txt > undocumented_tests.txt
> + artifacts:
> + paths:
> + - undocumented_tests.txt
> +
> +test:verify-blacklists:
s/blacklists:/blocklists:/
> + dependencies:
> + - build:tests-fedora
> + stage: test
> + script: for bl in tests/intel-ci/blacklist{,-pre-merge}.txt; do scripts/verify-blacklist.sh build/runner/igt_runner build/tests "$bl" || exit 1; done
Time to change this name also here...
> diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
> index 2ab8a48f6ae9..721fc6035b77 100644
> --- a/CONTRIBUTING.md
> +++ b/CONTRIBUTING.md
> @@ -78,6 +78,22 @@ Sending Patches
> - Changes to the testcases are automatically tested. Take the results into
> account before merging.
>
> +- When pushing a new series, your series will be build-tested by the CI. It is
> + useful to avoid merging broken stuff. You can run this CI locally by using the
> + project https://github.com/firecow/gitlab-ci-local. To install it, please
Remove dot '.' from end of www address, also split line there:
project https://github.com/firecow/gitlab-ci-local
To install it, please
> + refer to its README (on debian, the package gitlab-ci-local can be used).
> +
> + To run the CI, you need to build docker images:
> +
> + docker build . -f Dockerfile.build-fedora -t igt-build-fedora:latest
> +
> + Now you should be able to run the CI:
> +
> + gitlab-ci-local --file .gitlab-ci-local.yml
Hmm, what about a script for running it for igt? so no need for params
unless someone wants to run only to a stage below? So basically it could
also be a script plus config for it:
scripts/gitlab-local.sh
with config in scripts/gitlab-ci-local.yml
Regards,
Kamil
> +
> + If you want to run a specific stage, you can add it to the command line:
> +
> + gitlab-ci-local --file .gitlab-ci-local.yml <stage>
>
> Commit Rights
> -------------
>
> ---
> base-commit: f48806ee249015e967bb220eba8559c5e829d609
> change-id: 20240710-gitlab-ci-local-2751f8c4f26c
>
> Best regards,
> --
> Louis Chauvet <louis.chauvet at bootlin.com>
>
More information about the igt-dev
mailing list