ci/scripts: Specify arguments by args rather than env vars

This dehardcodes the builddir the scripts use, and allows
us to pass it as a cli argument.

It also allows us to pass the test stuite string as an
arg for test.sh

This makes the scripts a bit more usable for local development
as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7114>
This commit is contained in:
Jordan Petridis 2024-06-29 17:26:20 +03:00
parent cc1d978d7f
commit a80fef34a2
4 changed files with 41 additions and 18 deletions

View file

@ -333,7 +333,7 @@ commitlint:
# https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3197 # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3197
GI_SCANNER_DISABLE_CACHE: "1" GI_SCANNER_DISABLE_CACHE: "1"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- ./gst-env.py gst-inspect-1.0 --version - ./gst-env.py gst-inspect-1.0 --version
- ./gst-env.py gst-inspect-1.0 - ./gst-env.py gst-inspect-1.0
after_script: after_script:
@ -359,7 +359,7 @@ commitlint:
MESON_ARGS: "${SIMPLE_BUILD}" MESON_ARGS: "${SIMPLE_BUILD}"
SUBPROJECTS_CACHE_DIR: "/subprojects" SUBPROJECTS_CACHE_DIR: "/subprojects"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- ./gst-env.py gst-inspect-1.0 --version - ./gst-env.py gst-inspect-1.0 --version
- ./gst-env.py gst-inspect-1.0 - ./gst-env.py gst-inspect-1.0
- G_DEBUG=fatal_criticals ./gst-env.py gst-inspect-1.0 --print-all --gst-disable-registry-fork > /dev/null - G_DEBUG=fatal_criticals ./gst-env.py gst-inspect-1.0 --print-all --gst-disable-registry-fork > /dev/null
@ -640,8 +640,8 @@ build macos:
- mkdir -p ~/.config/gdb - mkdir -p ~/.config/gdb
- echo "set auto-load safe-path /" >> ~/.config/gdb/gdbinit - echo "set auto-load safe-path /" >> ~/.config/gdb/gdbinit
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- $CI_PROJECT_DIR/ci/scripts/test.sh - $CI_PROJECT_DIR/ci/scripts/test.sh build/ $TEST_SUITE
after_script: after_script:
- mv build/meson-logs/ meson-logs - mv build/meson-logs/ meson-logs
artifacts: artifacts:
@ -715,7 +715,7 @@ check video formats:
WL_TOKEN: "GST_WL_VIDEO_FORMATS" WL_TOKEN: "GST_WL_VIDEO_FORMATS"
WL_HEADER: "subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlvideoformat.h" WL_HEADER: "subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlvideoformat.h"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- $CI_PROJECT_DIR/ci/scripts/check-video-formats.sh - $CI_PROJECT_DIR/ci/scripts/check-video-formats.sh
rules: rules:
- changes: - changes:
@ -739,7 +739,7 @@ gstreamer-full static build:
-Ddoc=disabled -Ddoc=disabled
SUBPROJECTS_CACHE_DIR: "/subprojects" SUBPROJECTS_CACHE_DIR: "/subprojects"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- meson test -C build -v test-gst-full - meson test -C build -v test-gst-full
gstreamer-full-minimal static build: gstreamer-full-minimal static build:
@ -764,7 +764,7 @@ gstreamer-full-minimal static build:
SUBPROJECTS_CACHE_DIR: "/subprojects" SUBPROJECTS_CACHE_DIR: "/subprojects"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- meson test -C build -v test-gst-full - meson test -C build -v test-gst-full
- meson test -C build test-gst-full-features --test-args "-e filesrc,identity,fakesink -E filesink,capsfilter -t audio/x-wav -T video/vivo -d alsadeviceprovider -D v4l2deviceprovider -l GstVideoMultiviewFlagsSet" - meson test -C build test-gst-full-features --test-args "-e filesrc,identity,fakesink -E filesink,capsfilter -t audio/x-wav -T video/vivo -d alsadeviceprovider -D v4l2deviceprovider -l GstVideoMultiviewFlagsSet"
- strip build/libgstreamer-full-1.0.so - strip build/libgstreamer-full-1.0.so
@ -802,7 +802,7 @@ fluster v4l2-stateless on visl:
-Dgst-plugins-good:matroska=enabled -Dgst-plugins-good:matroska=enabled
SUBPROJECTS_CACHE_DIR: "/subprojects" SUBPROJECTS_CACHE_DIR: "/subprojects"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build.sh - $CI_PROJECT_DIR/ci/scripts/build.sh build/
- meson test -C build -v --suite v4l2-stateless-decoders - meson test -C build -v --suite v4l2-stateless-decoders
artifacts: artifacts:
reports: reports:
@ -941,7 +941,7 @@ valgrind ges:
SUBPROJECTS_CACHE_DIR: "/subprojects" SUBPROJECTS_CACHE_DIR: "/subprojects"
CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/" CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
script: script:
- $CI_PROJECT_DIR/ci/scripts/build-docs.sh - $CI_PROJECT_DIR/ci/scripts/build-docs.sh build/
artifacts: artifacts:
when: always when: always
expire_in: "7 days" expire_in: "7 days"

View file

@ -1,5 +1,12 @@
#! /bin/bash #! /bin/bash
builddir="$1"
if [[ -z "$builddir" ]]; then
echo "Usage: build-docs.sh <build_directory>"
exit 1
fi
set -eux set -eux
export PATH="/usr/local/cargo/bin/:/usr/local/bin/:$PATH" export PATH="/usr/local/cargo/bin/:/usr/local/bin/:$PATH"
@ -9,21 +16,21 @@ export CARGO_HOME="/usr/local/cargo"
./ci/scripts/handle-subprojects-cache.py --cache-dir /subprojects subprojects/ ./ci/scripts/handle-subprojects-cache.py --cache-dir /subprojects subprojects/
echo "$MESON_ARGS" echo "$MESON_ARGS"
meson setup build/ $MESON_ARGS meson setup "$builddir" $MESON_ARGS
ccache --show-stats ccache --show-stats
ninja -C build/ update_girs ninja -C "$builddir" update_girs
# Ignore modifications to wrap files made by meson # Ignore modifications to wrap files made by meson
git checkout $(git ls-files 'subprojects/*.wrap') git checkout $(git ls-files 'subprojects/*.wrap')
./ci/scripts/check-diff.py "gir files" ./ci/scripts/check-diff.py "gir files"
./gst-env.py ninja -C build/ plugins_doc_caches ./gst-env.py ninja -C "$builddir" plugins_doc_caches
# Ignore modifications to wrap files made by meson # Ignore modifications to wrap files made by meson
git checkout $(git ls-files 'subprojects/*.wrap') git checkout $(git ls-files 'subprojects/*.wrap')
./ci/scripts/check-diff.py ./ci/scripts/check-diff.py
export GI_TYPELIB_PATH="$PWD/girs" export GI_TYPELIB_PATH="$PWD/girs"
hotdoc run --conf-file build/subprojects/gst-docs/GStreamer-doc.json hotdoc run --conf-file "$builddir/subprojects/gst-docs/GStreamer-doc.json"
mv build/subprojects/gst-docs/GStreamer-doc/html documentation/ mv "$builddir/subprojects/gst-docs/GStreamer-doc/html" documentation/

View file

@ -1,5 +1,12 @@
#! /bin/bash #! /bin/bash
builddir="$1"
if [[ -z "$builddir" ]]; then
echo "Usage: build.sh <build_directory>"
exit 1
fi
set -eux set -eux
# Expects: # Expects:
@ -31,7 +38,7 @@ if [ "$GST_WERROR" = "true" ]; then
fi fi
date -R date -R
meson setup build/ --native-file ./ci/meson/gst-ci-cflags.ini ${ARGS} meson setup "$builddir" --native-file ./ci/meson/gst-ci-cflags.ini ${ARGS}
date -R date -R
if command -v ccache if command -v ccache
@ -40,7 +47,7 @@ then
fi fi
date -R date -R
meson compile -C build/ --jobs "$jobs" meson compile -C "$builddir" --jobs "$jobs"
date -R date -R
if command -v ccache if command -v ccache

View file

@ -1,5 +1,13 @@
#! /bin/bash #! /bin/bash
builddir="$1"
tests="$2"
if [[ -z "$builddir" || -z "$tests" ]]; then
echo "Usage: test.sh <build_directory> <test_name>"
exit 1
fi
set -eux set -eux
timeout="${TIMEOUT_FACTOR:="2"}" timeout="${TIMEOUT_FACTOR:="2"}"
@ -7,10 +15,11 @@ validate="${EXTRA_VALIDATE_ARGS:=""}"
parent="${CI_PROJECT_DIR:-$(pwd)}" parent="${CI_PROJECT_DIR:-$(pwd)}"
export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
echo "-> Running ${TEST_SUITE}" echo "-> Running $tests"
./gst-env.py \ ./gst-env.py \
gst-validate-launcher ${TEST_SUITE} \ "--builddir=$builddir" \
gst-validate-launcher "$tests" \
--check-bugs \ --check-bugs \
--dump-on-failure \ --dump-on-failure \
--mute \ --mute \