-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
88 lines (85 loc) · 2.64 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
build_docker_image:
image: docker:27
stage: build
services:
- docker:27-dind
script:
- cd ci/
- docker build -t $CI_REGISTRY/striezel/morrowtools/ci-cross-win64:12.2-deb12 . -f Dockerfile_cross_win64
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY/striezel/morrowtools/ci-cross-win64:12.2-deb12
- docker logout $CI_REGISTRY
# Only build new image when the Dockerfile or the GitLab CI configuration
# changes.
only:
changes:
- ci/Dockerfile_cross_win64
- .gitlab-ci.yml
win64_cross:
image: registry.gitlab.com/striezel/morrowtools/ci-cross-win64:12.2-deb12
stage: test
before_script:
- apt-get update && apt-get -y upgrade
script:
# build
- export CXX=x86_64-w64-mingw32-c++
- export CC=x86_64-w64-mingw32-gcc
- mkdir build
- cd build
- cmake -DENABLE_LTO=ON -DENABLE_STATIC_LINKING=ON ../
- make -j2
# tests
- ctest -V
# Collect build artifacts in one place.
- mkdir -p artifacts
- cp apps/mw/cell_translator/cell_translator.exe artifacts/
- cp apps/mw/data_cleaner/data_cleaner.exe artifacts/
- cp apps/mw/name_generator/name_generator_mw.exe artifacts/
- cp apps/mw/skill_rebalance/skill_rebalance.exe artifacts/
- cp apps/mw/spell_rename/spell_rename.exe artifacts/
- cp apps/sr/bsa_cli/bsa-cli.exe artifacts/
- cp apps/sr/conv_cams/conv_cams.exe artifacts/
- cp apps/sr/formID_finder/formID_finder.exe artifacts/
- cp apps/sr/small_high_elves/small_high_elves.exe artifacts/
# build artifacts
artifacts:
paths:
- build/artifacts/
coverage:
image: debian:12-slim
stage: test
before_script:
- apt-get update && apt-get -y upgrade
- apt-get install -y catch cmake g++-12 lcov libfuse3-dev liblz4-dev pkg-config zlib1g-dev
- apt-get install -y libasan8 libubsan1
script:
# build
- export CXX=g++-12
- export CC=gcc-12
- mkdir build-coverage
- cd build-coverage
- cmake -DCODE_COVERAGE=ON -DENABLE_SANITIZER=ON ../
- make -j2
# tests
- ctest -V
# collect code coverage data
- lcov -c --directory . --output-file main_coverage.info
- lcov --remove main_coverage.info '/usr/include/*' '*tests/*' -o main_coverage_filtered.info
- genhtml main_coverage_filtered.info --output-directory ../public
coverage: /^[\t ]*lines\.*:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 2 days
paths:
- public
pages:
image: debian:12-slim
stage: deploy
needs: ["coverage"]
dependencies:
- coverage
script:
- ls -l
artifacts:
paths:
- public