Merge pull request #357 from Exiv2/gitlab_deploy_test

Add Gitlab deploy stage
v0.27.3
D4N 7 years ago committed by GitHub
commit f1c4734e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,40 +1,91 @@
# default build for all distros # all builds use the same ccache folder in the project root that is cached
# only create artifacts of the build directory when something fails (for cmake logs) variables:
# cache the ccache/ directory for each job separately CCACHE_BASEDIR: '$CI_PROJECT_DIR'
.build_template: &distro_build CCACHE_DIR: '$CI_PROJECT_DIR/ccache'
# default config for all distros:
# - install dependencies via script
# - create ccache dir & setup caching of it (for each job separately)
.build_config: &default_config
before_script: before_script:
- ci/install_dependencies.sh - ci/install_dependencies.sh
- mkdir -p ccache
cache:
key: "$CI_JOB_NAME"
paths:
- ccache/
# default build job:
# - run build script
# - only create artifacts of the build directory when something fails
# (for cmake logs)
.build_template: &distro_build
script: script:
- python3 ci/test_build.py - python3 ci/test_build.py
artifacts: artifacts:
when: on_failure when: on_failure
paths: paths:
- build/ - build/
cache:
key: "$CI_JOB_NAME" stages:
paths: - test
- ccache/ - deploy
Fedora: Fedora:
image: fedora:28 image: fedora:28
<<: *default_config
<<: *distro_build <<: *distro_build
Debian: Debian:
image: debian:9 image: debian:9
<<: *default_config
<<: *distro_build <<: *distro_build
Archlinux: Archlinux:
image: base/archlinux image: base/archlinux
<<: *default_config
<<: *distro_build <<: *distro_build
Ubuntu: Ubuntu:
image: ubuntu:18.04 image: ubuntu:18.04
<<: *default_config
<<: *distro_build <<: *distro_build
CentOS: CentOS:
image: centos:7 image: centos:7
<<: *default_config
<<: *distro_build <<: *distro_build
OpenSUSE: OpenSUSE:
image: opensuse:tumbleweed image: opensuse:tumbleweed
<<: *default_config
<<: *distro_build <<: *distro_build
Install:
image: fedora:28
stage: deploy
<<: *default_config
script:
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX=/usr/ -DBUILD_WITH_CCACHE=ON ..
- make -j $(nproc)
- make install
- make clean
- EXIV2_BINDIR=/usr/bin/ make tests
pages:
image: fedora:28
stage: deploy
<<: *default_config
script:
- dnf -y install doxygen graphviz
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_DOC=ON ..
- make doc
- cd ..
- mv build/doc/html/ public/
artifacts:
paths:
- public
only:
- master

@ -124,7 +124,7 @@ endif()
## ##
# tests # tests
add_custom_target(tests COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) add_custom_target(tests COMMAND env EXIV2_BUILDDIR="${CMAKE_BINARY_DIR}" make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
include( config/printSummary.cmake ) include( config/printSummary.cmake )

@ -37,10 +37,8 @@ def call_wrapper(*args, **kwargs):
sys.exit(return_code) sys.exit(return_code)
# create build & ccache directory (ccache could already exist in the CI's cache) # create build directory
os.mkdir("build") os.mkdir("build")
if not os.path.exists('ccache'):
os.mkdir("ccache")
root_dir = os.path.abspath(os.getcwd()) root_dir = os.path.abspath(os.getcwd())
@ -64,11 +62,9 @@ for params in itertools.product(SHARED_LIBS, CCS, BUILD_TYPES):
env_copy = os.environ.copy() env_copy = os.environ.copy()
env_copy["CC"] = cc env_copy["CC"] = cc
env_copy["CXX"] = cxx env_copy["CXX"] = cxx
env_copy["CCACHE_BASEDIR"] = root_dir
env_copy["CCACHE_DIR"] = os.path.join(root_dir, "ccache")
# location of the binaries for the new test suite: # location of the binaries for the new test suite:
env_copy["EXIV2_PATH"] = os.path.join(cwd, "bin") env_copy["EXIV2_BINDIR"] = os.path.join(cwd, "bin")
kwargs = {"env": env_copy, "cwd": cwd} kwargs = {"env": env_copy, "cwd": cwd}

@ -1596,7 +1596,7 @@ TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create # When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads. # a tag file that is based on the input files it reads.
GENERATE_TAGFILE = html/exiv2.xml GENERATE_TAGFILE = doc/html/exiv2.xml
# If the ALLEXTERNALS tag is set to YES all external classes will be listed # If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes # in the class index. If set to NO only the inherited external classes

@ -442,7 +442,11 @@ prepareTest()
datadir="../data" datadir="../data"
if [ -z "$EXIV2_BINDIR" ] ; then if [ -z "$EXIV2_BINDIR" ] ; then
bin="$here/../bin/" if [ -z "$EXIV2_BUILDDIR" ]; then
bin="$EXIV2_BUILDDIR/bin/"
else
bin="$here/../build/bin/"
fi
else else
bin="$EXIV2_BINDIR/" bin="$EXIV2_BINDIR/"
fi fi

@ -2,7 +2,7 @@
timeout: 1 timeout: 1
[ENV] [ENV]
exiv2_path: EXIV2_PATH exiv2_path: EXIV2_BINDIR
binary_extension: EXIV2_EXT binary_extension: EXIV2_EXT
[ENV fallback] [ENV fallback]

Loading…
Cancel
Save