Skip to content
Snippets Groups Projects
Verified Commit ac63f92f authored by Hueser, Christian's avatar Hueser, Christian
Browse files

Add reference solution for exercise 1 in episode 7

* Add reference solution for exercise 1 in episode 7 regarding using
includes to restructure the CI pipeline and splitting it up into
multiple files.
parent 40393bea
No related branches found
No related tags found
No related merge requests found
......@@ -5,15 +5,8 @@
---
stages:
- lint
- build
- test
- run
default:
image: python:3.11
interruptible: true
image: python:3.9
.install_dependencies:
before_script:
......@@ -23,57 +16,12 @@ default:
.compiler_versions:
parallel:
matrix:
- VERSION: [ "11", "12" ]
license_compliance:
stage: lint
before_script:
- pip install --upgrade pip
- pip install reuse
script:
- reuse lint
interruptible: true
lint:
stage: lint
before_script:
- pip install --upgrade pip
- pip install cpplint
script:
- cpplint --recursive src/ tests/
build:gcc:
extends:
- .install_dependencies
- .compiler_versions
stage: build
image: gcc:${VERSION}
script:
- cmake -S . -B build_gcc_${VERSION}
- cmake --build build_gcc_${VERSION}
artifacts:
paths:
- build_gcc_${VERSION}
test:gcc:
extends:
- .install_dependencies
- .compiler_versions
stage: test
image: gcc:${VERSION}
script:
- cd build_gcc_${VERSION} && ctest
needs:
- job: "build:gcc"
artifacts: true
- VERSION: [ "10", "11", "12" ]
run:
stage: run
image: gcc:12
script:
- ./build_gcc_12/bin/helloWorld
needs:
- job: "build:gcc"
artifacts: true
include:
- local: ".gitlab/ci/lint.gitlab-ci.yml"
- local: ".gitlab/ci/build.gitlab-ci.yml"
- local: ".gitlab/ci/test.gitlab-ci.yml"
- local: ".gitlab/ci/run.gitlab-ci.yml"
...
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: MIT
---
build:gcc:
image: gcc:${VERSION}
extends:
- .install_dependencies
- .compiler_versions
script:
- cmake -S . -B build_gcc_${VERSION}
- cmake --build build_gcc_${VERSION}
artifacts:
paths:
- build_gcc_${VERSION}
needs: ["lint"]
interruptible: true
...
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: MIT
---
license_compliance:
before_script:
- pip install --upgrade pip
- pip install reuse
script:
- reuse lint
interruptible: true
lint:
before_script:
- pip install --upgrade pip
- pip install cpplint
script:
- cpplint --recursive src/ tests/
interruptible: true
...
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: MIT
---
run:
image: gcc:11
script:
- cd build_gcc_11/bin/ && ./helloWorld
dependencies: ["build:gcc"]
needs: ["build:gcc", "test:gcc"]
interruptible: true
...
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: MIT
---
test:gcc:
image: gcc:${VERSION}
extends:
- .install_dependencies
- .compiler_versions
script:
- cd build_gcc_${VERSION} && ctest
dependencies: ["build:gcc"]
needs: ["build:gcc"]
interruptible: true
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment