Improve CI configuration

- Fix docker Fedora image to Fedora:31
  - Fix gcc version to gcc-9.2.1
  - Use GitLab CI dag
  - Fix usage of build cache
  - Introduce build artificats
This commit is contained in:
David Tellenbach 2020-07-24 15:58:44 +00:00
parent fb0c6868ad
commit b8ca93842c

View File

@ -14,34 +14,40 @@ stages:
variables: variables:
CMAKE_GENERATOR: "Ninja" CMAKE_GENERATOR: "Ninja"
BUILDDIR: builddir
.build-tests: .build-tests:
allow_failure: true allow_failure: true
stage: build stage: build
image: fedora image: fedora:31
before_script: before_script:
- dnf -y install gcc-c++ cmake make ninja-build - dnf -y install gcc-c++-9.2.1 cmake make ninja-build
script: script:
- cmake -B builddir -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} - cmake -B ${BUILDDIR} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11}
- cmake --build builddir --target buildtests - cmake --build ${BUILDDIR} --target buildtests
cache: cache:
key: "$CI_JOB_NAME" key: "build-cache-cxx11-${EIGEN_TEST_CXX11}"
paths: paths:
- builddir/ - ${BUILDDIR}/
policy: push policy: push
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- ${BUILDDIR}/
expire_in: 5 days
.run_tests: .run_tests:
allow_failure: true allow_failure: true
stage: test stage: test
image: fedora image: fedora:31
before_script: before_script:
- dnf -y install cmake - dnf -y install gcc-c++-9.2.1 cmake make ninja-build
script: script:
- cd builddir && ctest --output-on-failure - cd ${BUILDDIR} && ctest --output-on-failure
cache: cache:
key: "$CI_JOB_NAME" key: "build-cache-cxx11-${EIGEN_TEST_CXX11}"
paths: paths:
- builddir/ - ${BUILDDIR}/
policy: pull policy: pull
build-test-cxx11-on: build-test-cxx11-on:
@ -56,26 +62,29 @@ build-test-cxx11-off:
run-tests-cxx11-on: run-tests-cxx11-on:
extends: .run_tests extends: .run_tests
dependencies: variables:
- build-test-cxx11-on EIGEN_TEST_CXX11: "ON"
needs: ["build-test-cxx11-on"]
run-tests-cxx11-off: run-tests-cxx11-off:
extends: .run_tests extends: .run_tests
dependencies: variables:
- build-test-cxx11-off EIGEN_TEST_CXX11: "OFF"
needs: ["build-test-cxx11-off"]
build-doc: build-doc:
image: fedora:31
only: only:
- schedules - schedules
image: fedora
stage: doc stage: doc
before_script: before_script:
- dnf -y install g++ cmake make doxygen doxygen-latex - dnf -y install gcc-c++-9.2.1 cmake make doxygen doxygen-latex
script: script:
- cmake -G "Unix Makefiles" -B builddir -DCMAKE_BUILD_TYPE=Release - cmake -G "Unix Makefiles" -B ${BUILDDIR} -DCMAKE_BUILD_TYPE=Release
- cmake --build builddir --target doc - cmake --build ${BUILDDIR} --target doc
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_JOB_ID" name: "$CI_JOB_NAME-$CI_JOB_ID"
paths: paths:
- builddir/doc/html - ${BUILDDIR}/doc/html
expire_in: 2 days expire_in: 2 days
needs: []