-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path.gitlab-ci.yml
93 lines (88 loc) · 2.83 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
default:
tags:
- docker
- linux
stages:
- test
- deploy
- sync
# TEST ug4
build-and-test:
stage: test
image: ubuntu:24.04
timeout: 4 hours
parallel:
matrix:
- UG_BUILD_ID: build-gcc-13
UG_C_COMPILER: "gcc"
UG_CXX_COMPILER: "g++"
- UG_BUILD_ID: build-clang-15
UG_C_COMPILER: "clang-15"
UG_CXX_COMPILER: "clang++-15"
#tags:
# - ${PROVIDER}-${STACK}
#environment: $PROVIDER/$STACK
variables:
UGHUB_DIR: "$CI_PROJECT_DIR/ughub"
UG4_OLD_DIR: "$CI_PROJECT_DIR/ug4-old"
UG4_NEW_DIR: "$CI_PROJECT_DIR/ug4-new"
before_script:
- echo "Setting up base ug4 enviroment."
- mkdir -p $UG4_NEW_DIR/ugcore
- mv * $UG4_NEW_DIR/ugcore || true
- apt-get update >/dev/null && apt-get install -y python3 git cmake build-essential clang-15 >/dev/null
- cd $CI_PROJECT_DIR && git clone https://gitlab.com/ug4-project/ughub.git
- export PATH="$PATH:$UGHUB_DIR"
- mkdir $UG4_OLD_DIR && cd $UG4_OLD_DIR
- ughub init && ughub install ugcore ConvectionDiffusion
- git clone https://gitlab.com/ug4-project/apps/unit_tests.git $UG4_OLD_DIR/apps/unit_tests
script:
- echo "Building and testing ug4"
# copy ug4 except for ugcore
- cd $CI_PROJECT_DIR
- cp --update=none -R $UG4_OLD_DIR/* $UG4_NEW_DIR
# build ug4 in release
- cd $UG4_NEW_DIR
- mkdir -p $UG_BUILD_ID && cd $UG_BUILD_ID
- cmake .. -DENABLE_ALL_PLUGINS=ON -DDEBUG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=$UG_CXX_COMPILER -DCMAKE_C_COMPILER=$UG_C_COMPILER
- make -j 4
# build testsuite
- cd $UG4_NEW_DIR/apps/unit_tests
- mkdir -p $UG_BUILD_ID && cd $UG_BUILD_ID
- cmake .. -DUSE_JSON=OFF -DINTERNAL_BOOST=ON -DDEBUG=OFF -DCMAKE_BUILD_TYPE=Release
- make -j 4
- cd $UG4_NEW_DIR
- source ugcore/scripts/shell/ugbash
- ./bin/testsuite --build-info=yes --log_level=all --log_format=JUNIT --log_sink=report.xml -- --name report
- mv ug_test_numprocs_1.log test.log
artifacts:
when: always
expire_in: 1 week
paths:
- $UG4_NEW_DIR/report.xml
- $UG4_NEW_DIR/test.log
# - $UG4_NEW_DIR/lib/*
- $UG4_NEW_DIR/bin/*
- $UG4_NEW_DIR/bin/plugins/*
reports:
junit: $UG4_NEW_DIR/report.xml
# BUILD sources on various platforms and compilers
deploy-docker:
stage: deploy
image: docker:latest
before_script:
- docker info
- echo "$CI_REGISTRY"
- echo "$CI_JOB_TOKEN" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
script:
# build docker image
- docker build -t registry.gitlab.com/ug4-project/ugcore .
- docker push registry.gitlab.com/ug4-project/ugcore
rules:
- if: $CI_COMMIT_TAG
include:
- template: Jobs/SAST.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
# - local: '/.gitlab/mirror-main.yml' # Push mirror is disabled.
sast:
stage: test