Skip to content
Snippets Groups Projects
Commit 2f8597d2 authored by Mark de Wever's avatar Mark de Wever
Browse files

CWG-34 Add ABI breakage CI test

parent 5d672b71
Branches
No related tags found
1 merge request!4CWG-34 Add ABI breakage CI test
Pipeline #46247 waiting for manual action
...@@ -11,6 +11,7 @@ workflow: ...@@ -11,6 +11,7 @@ workflow:
# Set to 1 to force a rebuild of the Docker image # Set to 1 to force a rebuild of the Docker image
variables: variables:
BUILD_DOCKER_IMAGE: "0" BUILD_DOCKER_IMAGE: "0"
APPLICATION_LAST_RELEASE: "0.0.0"
stages: stages:
- versioning - versioning
...@@ -19,6 +20,7 @@ stages: ...@@ -19,6 +20,7 @@ stages:
- build - build
- test - test
- pages - pages
- deploy
# This step determines the SHA1 of the Docker file used. It's stored in # This step determines the SHA1 of the Docker file used. It's stored in
# versions.env artifact. The environment variables are available for all steps # versions.env artifact. The environment variables are available for all steps
......
...@@ -52,6 +52,26 @@ test: ...@@ -52,6 +52,26 @@ test:
coverage_format: cobertura coverage_format: cobertura
path: build/coverage.xml path: build/coverage.xml
# See https://git.astron.nl/templates/cpp-project/-/wikis/ABI%20checker
abi-test:
stage: test
needs: ["versioning", "build-docker-ubuntu-22.04"]
image: $BASE_IMAGE
script:
# The syntax is described at https://docs.gitlab.com/ee/user/packages/generic_packages/index.html
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ABI/${APPLICATION_LAST_RELEASE}/abi.dump" -o abi.dump'
- cmake --version
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-Og -gdwarf-3" -GNinja ..
- ninja
- cd ..
- abi-dumper build/src/lib/libhello.so -o master.dump -lver master
# ABI failures are not only intended to be informative
- abi-compliance-checker -l hello -old abi.dump -new master.dump || true
artifacts:
paths:
- compat_reports/hello/${APPLICATION_LAST_RELEASE}_to_master
build: build:
stage: build stage: build
needs: ["versioning", "build-docker-ubuntu-22.04"] needs: ["versioning", "build-docker-ubuntu-22.04"]
...@@ -74,3 +94,20 @@ pages: ...@@ -74,3 +94,20 @@ pages:
# Extract HTML coverage report. # Extract HTML coverage report.
- tar xfz coverage.tar.gz - tar xfz coverage.tar.gz
# TODO: Add an index page with links to the documentation and coverage. # TODO: Add an index page with links to the documentation and coverage.
abi-deplay:
stage: deploy
needs: ["versioning", "build-docker-ubuntu-22.04"]
image: $BASE_IMAGE
environment: production
script:
- cmake --version
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-Og -gdwarf-3" -GNinja ..
- ninja
- cd ..
- abi-dumper build/src/lib/libhello.so -o ${APPLICATION_LAST_RELEASE}.dump -lver ${APPLICATION_LAST_RELEASE}
# The syntax is described at https://docs.gitlab.com/ee/user/packages/generic_packages/index.html
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${APPLICATION_LAST_RELEASE}.dump "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ABI/${APPLICATION_LAST_RELEASE}/abi.dump"'
rules:
- when: manual
...@@ -7,11 +7,14 @@ FROM ubuntu:22.04 ...@@ -7,11 +7,14 @@ FROM ubuntu:22.04
RUN export DEBIAN_FRONTEND=noninteractive && \ RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y \
abi-compliance-checker \
abi-dumper \
build-essential \ build-essential \
clang-format \ clang-format \
clang-tidy \ clang-tidy \
cmake \ cmake \
cmake-format \ cmake-format \
curl \
doxygen \ doxygen \
gcovr \ gcovr \
git \ git \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment