CI: turn BUILDDIR and PREFIX into CI variables

Change BUILDDIR and PREFIX from exported shell variables into CI
variables. This way they can be used in CI configuration, e.g.
artifacts.

The main reason for this change is that it makes it possible to use
these variables in after_script, which is not possible with shell
variables as the values do not carry over there.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 3 years ago committed by Daniel Stone
parent c76cf48f3e
commit b27f539714
  1. 28
      .gitlab-ci.yml

@ -37,6 +37,9 @@ container_prep:
- .fdo.distribution-image@debian - .fdo.distribution-image@debian
timeout: 5m timeout: 5m
stage: build stage: build
variables:
BUILDDIR: $CI_PROJECT_DIR/build-weston-$CI_JOB_NAME
PREFIX: $CI_PROJECT_DIR/prefix-weston-$CI_JOB_NAME
before_script: before_script:
- git clone --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols - git clone --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols
- export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols" - export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols"
@ -50,9 +53,6 @@ container_prep:
- make install - make install
- cd ../../ - cd ../../
- export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" - export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
- export BUILD_ID="weston-$CI_JOB_NAME"
- export PREFIX="$(pwd)/prefix-$BUILD_ID"
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- export TESTS_RES_PATH="$BUILDDIR/tests-res.txt" - export TESTS_RES_PATH="$BUILDDIR/tests-res.txt"
- mkdir "$BUILDDIR" "$PREFIX" - mkdir "$BUILDDIR" "$PREFIX"
@ -76,12 +76,12 @@ container_prep:
name: weston-$CI_COMMIT_SHA name: weston-$CI_COMMIT_SHA
when: always when: always
paths: paths:
- build-*/*.png - $BUILDDIR/*.png
- build-*/meson-logs - $BUILDDIR/meson-logs
- build-*/weston-virtme - $BUILDDIR/weston-virtme
- prefix-* - $PREFIX
reports: reports:
junit: build-*/meson-logs/testlog.junit.xml junit: $BUILDDIR/meson-logs/testlog.junit.xml
.build-native-meson-no-test: .build-native-meson-no-test:
extends: .build-native extends: .build-native
@ -98,8 +98,8 @@ container_prep:
name: weston-$CI_COMMIT_SHA name: weston-$CI_COMMIT_SHA
when: always when: always
paths: paths:
- build-*/meson-logs - $BUILDDIR/meson-logs
- prefix-* - $PREFIX
build-native-meson-default-options: build-native-meson-default-options:
variables: variables:
@ -111,12 +111,12 @@ build-native-meson-default-options:
-Dlauncher-libseat=true -Dlauncher-libseat=true
extends: .build-native-meson extends: .build-native-meson
after_script: after_script:
- ninja -C build-* coverage-html - ninja -C "$BUILDDIR" coverage-html
- ninja -C build-* coverage-xml - ninja -C "$BUILDDIR" coverage-xml
- sed -i -e 's/\/build-weston-build-native-meson-default-options//' -e 's/\"..\//\"/' build-*/meson-logs/coverage.xml - sed -i -e 's/\/build-weston-build-native-meson-default-options//' -e 's/\"..\//\"/' "$BUILDDIR/meson-logs/coverage.xml"
artifacts: artifacts:
reports: reports:
cobertura: build-*/meson-logs/coverage.xml cobertura: $BUILDDIR/meson-logs/coverage.xml
build-docs: build-docs:
variables: variables:

Loading…
Cancel
Save