CI: fix the ABI check job, it was using the wrong HEAD

The ABI job git cloned from upstream and then compared HEAD with the
last ABI break. Problem though: the HEAD was origin/main, not the actual
HEAD from the merge request.

Fix this by adding upstream as a remote and fetching from it. And while
we're there update to the last ABI break commit sha and move the
abicheck bits into before_script.

Note that the remote has the CI job ID appended, this avoids conflicts
when the git repo is re-used betweenn jobs and the upstream remote
already exists.
This commit is contained in:
Peter Hutterer 2023-06-06 10:23:54 +10:00
parent 95366ea131
commit 1cf9412990
3 changed files with 11 additions and 13 deletions

View file

@ -276,9 +276,8 @@ abicheck@fedora:38:
extends:
- .fedora-build@template
variables:
GIT_STRATEGY: none # We need the upstream repo instead
MESON_ARGS: '-Dwerror=true'
script:
before_script:
- git clone --depth=1 https://gitlab.freedesktop.org/hadess/check-abi
- |
pushd check-abi
@ -286,10 +285,10 @@ abicheck@fedora:38:
meson compile -C _build
meson install -C _build
popd
- git clone --depth=1 https://gitlab.freedesktop.org/$FDO_UPSTREAM_REPO
- cd libei
- git fetch --tags
- check-abi 0.99.1 HEAD
script:
- git remote add upstream$CI_JOB_ID https://gitlab.freedesktop.org/$FDO_UPSTREAM_REPO
- git fetch --tags upstream$CI_JOB_ID
- check-abi 168de89a70deb173a32b58b313ddc0aa13310f9a $CI_COMMIT_SHA
only:
- merge_requests

View file

@ -276,9 +276,8 @@ abicheck@{{distro.name}}:{{version}}:
extends:
- .{{distro.name}}-build@template
variables:
GIT_STRATEGY: none # We need the upstream repo instead
MESON_ARGS: '-Dwerror=true'
script:
before_script:
- git clone --depth=1 https://gitlab.freedesktop.org/hadess/check-abi
- |
pushd check-abi
@ -286,10 +285,10 @@ abicheck@{{distro.name}}:{{version}}:
meson compile -C _build
meson install -C _build
popd
- git clone --depth=1 https://gitlab.freedesktop.org/$FDO_UPSTREAM_REPO
- cd libei
- git fetch --tags
- check-abi {{last_abi_break}} HEAD
script:
- git remote add upstream$CI_JOB_ID https://gitlab.freedesktop.org/$FDO_UPSTREAM_REPO
- git fetch --tags upstream$CI_JOB_ID
- check-abi {{last_abi_break}} $CI_COMMIT_SHA
only:
- merge_requests

View file

@ -5,7 +5,7 @@
# We're happy to rebuild all containers when one changes.
.default_tag: &default_tag '2023-05-25.0'
last_abi_break: 0.99.1
last_abi_break: 168de89a70deb173a32b58b313ddc0aa13310f9a
minimum_meson_version: 0.56.0
distributions: