.gitlab-ci.yml 8.06 KB
Newer Older
psi29a's avatar
psi29a committed
1 2
stages:
  - build
3 4

.Debian:
psi29a's avatar
psi29a committed
5
  tags:
6 7
    - docker
    - linux
8
  image: debian:bullseye
psi29a's avatar
psi29a committed
9 10
  cache:
    paths:
psi29a's avatar
psi29a committed
11
    - apt-cache/
Icecream95's avatar
Icecream95 committed
12
    - ccache/
psi29a's avatar
psi29a committed
13 14 15
  before_script:
    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
    - apt-get update -yq 
16
    - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-iostreams-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt5opengl5-dev libopenal-dev libopenscenegraph-dev libunshield-dev libtinyxml-dev libmygui-dev libbullet-dev liblz4-dev ccache git clang
psi29a's avatar
psi29a committed
17
  stage: build
Icecream95's avatar
Icecream95 committed
18 19 20
  script:
    - export CCACHE_BASEDIR="`pwd`"
    - export CCACHE_DIR="`pwd`/ccache" && mkdir -pv "$CCACHE_DIR"
21
    - ccache -z -M "${CCACHE_SIZE}"
22 23 24 25 26
    - CI/before_script.linux.sh
    - cd build
    - cmake --build . -- -j $(nproc)
    - cmake --install .
    - if [[ "${BUILD_TESTS_ONLY}" ]]; then ./openmw_test_suite; fi
Icecream95's avatar
Icecream95 committed
27
    - ccache -s
psi29a's avatar
psi29a committed
28 29
  artifacts:
    paths:
30 31 32 33
      - build/install/

Debian_GCC:
  extends: .Debian
elsid's avatar
elsid committed
34
  cache:
35
    key: Debian_GCC.v2
36 37 38
  variables:
    CC: gcc
    CXX: g++
39
    CCACHE_SIZE: 3G
AnyOldName3's avatar
AnyOldName3 committed
40 41
  # When CCache doesn't exist (e.g. first build on a fork), build takes more than 1h, which is the default for forks.
  timeout: 2h
42 43 44

Debian_GCC_tests:
  extends: .Debian
elsid's avatar
elsid committed
45
  cache:
46
    key: Debian_GCC_tests.v2
47 48 49
  variables:
    CC: gcc
    CXX: g++
50
    CCACHE_SIZE: 1G
51
    BUILD_TESTS_ONLY: 1
52

53 54
Debian_Clang:
  extends: .Debian
elsid's avatar
elsid committed
55
  cache:
56
    key: Debian_Clang.v2
57 58 59
  variables:
    CC: clang
    CXX: clang++
60
    CCACHE_SIZE: 2G
61 62 63

Debian_Clang_tests:
  extends: .Debian
elsid's avatar
elsid committed
64
  cache:
65
    key: Debian_Clang_tests.v2
66 67 68
  variables:
    CC: clang
    CXX: clang++
69
    CCACHE_SIZE: 1G
70 71
    BUILD_TESTS_ONLY: 1

psi29a's avatar
psi29a committed
72
MacOS:
psi29a's avatar
psi29a committed
73
  tags:
psi29a's avatar
psi29a committed
74
    - macos
psi29a's avatar
psi29a committed
75
  stage: build
76 77 78
  only:
    variables:
      - $CI_PROJECT_ID == "7107382"
psi29a's avatar
psi29a committed
79
  script:
80
    - rm -fr build/*  # remove anything in the build directory
81
    - CI/before_install.osx.sh
psi29a's avatar
psi29a committed
82
    - CI/before_script.osx.sh
psi29a's avatar
psi29a committed
83
    - cd build; make -j2 package
AnyOldName3's avatar
AnyOldName3 committed
84
    - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${CI_COMMIT_REF_NAME}_${CI_JOB_ID}.dmg"; done
psi29a's avatar
psi29a committed
85 86
  artifacts:
    paths:
Bret Curtis's avatar
Bret Curtis committed
87
      - build/OpenMW-*.dmg
88
      - "build/**/*.log"
Bret Curtis's avatar
Bret Curtis committed
89

90
variables: &engine-targets
91
  targets: "openmw,openmw-essimporter,openmw-iniimporter,openmw-launcher,openmw-wizard"
92 93

variables: &cs-targets
94
  targets: "openmw-cs,bsatool,esmtool,niftest"
95

AnyOldName3's avatar
AnyOldName3 committed
96
.Windows_Ninja_Base:
Bret Curtis's avatar
Bret Curtis committed
97
  tags:
psi29a's avatar
psi29a committed
98
    - windows
99
  before_script:
AnyOldName3's avatar
AnyOldName3 committed
100
  - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
AnyOldName3's avatar
AnyOldName3 committed
101
  - choco source add -n=openmw-proxy -s="https://repo.openmw.org/repository/Chocolatey/" --priority=1
AnyOldName3's avatar
AnyOldName3 committed
102 103
  - choco install git --force --params "/GitAndUnixToolsOnPath" -y
  - choco install 7zip -y
104
  - choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' -y
AnyOldName3's avatar
AnyOldName3 committed
105 106 107 108
  - choco install vswhere -y
  - choco install ninja -y
  - choco install python -y
  - refreshenv
109 110
  stage: build
  script:
AnyOldName3's avatar
AnyOldName3 committed
111 112 113 114 115 116
    - $time = (Get-Date -Format "HH:mm:ss")
    - echo ${time}
    - echo "started by ${GITLAB_USER_NAME}"
    - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -N
    - cd MSVC2019_64_Ninja
    - .\ActivateMSVC.ps1
117
    - cmake --build . --config $config --target ($targets.Split(','))
AnyOldName3's avatar
AnyOldName3 committed
118
    - cd $config
119 120
    - |
      if (Get-ChildItem -Recurse *.pdb) {
AnyOldName3's avatar
AnyOldName3 committed
121 122
        7z a -tzip ..\..\OpenMW_MSVC2019_64_${config}_${CI_COMMIT_REF_NAME}_${CI_JOB_ID}_symbols.zip '*.pdb'
        Get-ChildItem -Recurse *.pdb | Remove-Item
123
      }
AnyOldName3's avatar
AnyOldName3 committed
124
    - 7z a -tzip ..\..\OpenMW_MSVC2019_64_${config}_${CI_COMMIT_REF_NAME}_${CI_JOB_ID}.zip '*'
125 126
  after_script:
    - Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log
127
  cache:
AnyOldName3's avatar
AnyOldName3 committed
128
    key: ninja-v2
129 130
    paths:
    - deps
131
    - MSVC2019_64_Ninja/deps/Qt
132 133 134
  artifacts:
    when: always
    paths:
AnyOldName3's avatar
AnyOldName3 committed
135 136
    - "*.zip"
    - "*.log"
137
    - MSVC2019_64_Ninja/*.log
138 139 140 141 142 143 144
    - MSVC2019_64_Ninja/*/*.log
    - MSVC2019_64_Ninja/*/*/*.log
    - MSVC2019_64_Ninja/*/*/*/*.log
    - MSVC2019_64_Ninja/*/*/*/*/*.log
    - MSVC2019_64_Ninja/*/*/*/*/*/*.log
    - MSVC2019_64_Ninja/*/*/*/*/*/*/*.log
    - MSVC2019_64_Ninja/*/*/*/*/*/*/*/*.log
145

146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
Windows_Ninja_Engine_Release:
  extends:
    - .Windows_Ninja_Base
  variables:
    <<: *engine-targets
    config: "Release"

Windows_Ninja_Engine_Debug:
  extends:
    - .Windows_Ninja_Base
  variables:
    <<: *engine-targets
    config: "Debug"

Windows_Ninja_Engine_RelWithDebInfo:
  extends:
    - .Windows_Ninja_Base
  variables:
    <<: *engine-targets
    config: "RelWithDebInfo"

Windows_Ninja_CS_Release:
AnyOldName3's avatar
AnyOldName3 committed
168 169 170
  extends:
    - .Windows_Ninja_Base
  variables:
171
    <<: *cs-targets
172
    config: "Release"
173

174
Windows_Ninja_CS_Debug:
AnyOldName3's avatar
AnyOldName3 committed
175 176 177
  extends:
    - .Windows_Ninja_Base
  variables:
178
    <<: *cs-targets
179
    config: "Debug"
AnyOldName3's avatar
AnyOldName3 committed
180

181
Windows_Ninja_CS_RelWithDebInfo:
AnyOldName3's avatar
AnyOldName3 committed
182 183 184
  extends:
    - .Windows_Ninja_Base
  variables:
185
    <<: *cs-targets
186
    config: "RelWithDebInfo"
AnyOldName3's avatar
AnyOldName3 committed
187 188

.Windows_MSBuild_Base:
189 190 191
  tags:
    - windows
  before_script:
AnyOldName3's avatar
AnyOldName3 committed
192
  - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
AnyOldName3's avatar
AnyOldName3 committed
193
  - choco source add -n=openmw-proxy -s="https://repo.openmw.org/repository/Chocolatey/" --priority=1
AnyOldName3's avatar
AnyOldName3 committed
194 195 196 197 198 199
  - choco install git --force --params "/GitAndUnixToolsOnPath" -y
  - choco install 7zip -y
  - choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' -y
  - choco install vswhere -y
  - choco install python -y
  - refreshenv
Bret Curtis's avatar
Bret Curtis committed
200 201
  stage: build
  script:
AnyOldName3's avatar
AnyOldName3 committed
202 203 204 205 206
    - $time = (Get-Date -Format "HH:mm:ss")
    - echo ${time}
    - echo "started by ${GITLAB_USER_NAME}"
    - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V
    - cd MSVC2019_64
207
    - cmake --build . --config $config --target ($targets.Split(','))
AnyOldName3's avatar
AnyOldName3 committed
208
    - cd $config
209 210
    - |
      if (Get-ChildItem -Recurse *.pdb) {
AnyOldName3's avatar
AnyOldName3 committed
211 212
        7z a -tzip ..\..\OpenMW_MSVC2019_64_${config}_${CI_COMMIT_REF_NAME}_${CI_JOB_ID}_symbols.zip '*.pdb'
        Get-ChildItem -Recurse *.pdb | Remove-Item
213
      }
AnyOldName3's avatar
AnyOldName3 committed
214
    - 7z a -tzip ..\..\OpenMW_MSVC2019_64_${config}_${CI_COMMIT_REF_NAME}_${CI_JOB_ID}.zip '*'
215 216
  after_script:
    - Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log
Bret Curtis's avatar
Bret Curtis committed
217
  cache:
AnyOldName3's avatar
AnyOldName3 committed
218
    key: msbuild-v2
Bret Curtis's avatar
Bret Curtis committed
219
    paths:
psi29a's avatar
psi29a committed
220
    - deps
221
    - MSVC2019_64/deps/Qt
Bret Curtis's avatar
Bret Curtis committed
222
  artifacts:
223
    when: always
Bret Curtis's avatar
Bret Curtis committed
224
    paths:
AnyOldName3's avatar
AnyOldName3 committed
225 226
    - "*.zip"
    - "*.log"
227
    - MSVC2019_64/*.log
228 229 230 231 232 233 234
    - MSVC2019_64/*/*.log
    - MSVC2019_64/*/*/*.log
    - MSVC2019_64/*/*/*/*.log
    - MSVC2019_64/*/*/*/*/*.log
    - MSVC2019_64/*/*/*/*/*/*.log
    - MSVC2019_64/*/*/*/*/*/*/*.log
    - MSVC2019_64/*/*/*/*/*/*/*/*.log
AnyOldName3's avatar
AnyOldName3 committed
235

236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
Windows_MSBuild_Engine_Release:
  extends:
    - .Windows_MSBuild_Base
  variables:
    <<: *engine-targets
    config: "Release"

Windows_MSBuild_Engine_Debug:
  extends:
    - .Windows_MSBuild_Base
  variables:
    <<: *engine-targets
    config: "Debug"

Windows_MSBuild_Engine_RelWithDebInfo:
  extends:
    - .Windows_MSBuild_Base
  variables:
    <<: *engine-targets
    config: "RelWithDebInfo"

Windows_MSBuild_CS_Release:
AnyOldName3's avatar
AnyOldName3 committed
258 259 260
  extends:
    - .Windows_MSBuild_Base
  variables:
261
    <<: *cs-targets
262
    config: "Release"
AnyOldName3's avatar
AnyOldName3 committed
263

264
Windows_MSBuild_CS_Debug:
AnyOldName3's avatar
AnyOldName3 committed
265 266 267
  extends:
    - .Windows_MSBuild_Base
  variables:
268
    <<: *cs-targets
269
    config: "Debug"
AnyOldName3's avatar
AnyOldName3 committed
270

271
Windows_MSBuild_CS_RelWithDebInfo:
AnyOldName3's avatar
AnyOldName3 committed
272 273 274
  extends:
    - .Windows_MSBuild_Base
  variables:
275
    <<: *cs-targets
276
    config: "RelWithDebInfo"
psi29a's avatar
psi29a committed
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307

Debian_AndroidNDK_arm64-v8a:
  tags:
    - linux
  image: debian:bullseye
  variables:
    CCACHE_SIZE: 3G
  cache:
    key: Debian_AndroidNDK_arm64-v8a.v2
    paths:
      - apt-cache/
      - ccache/
  before_script:
    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
    - echo "deb http://deb.debian.org/debian unstable main contrib" > /etc/apt/sources.list
    - echo "google-android-ndk-installer google-android-installers/mirror select https://dl.google.com" | debconf-set-selections
    - apt-get update -yq
    - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake ccache curl unzip git build-essential google-android-ndk-installer
  stage: build
  script:
    - export CCACHE_BASEDIR="`pwd`"
    - export CCACHE_DIR="`pwd`/ccache" && mkdir -pv "$CCACHE_DIR"
    - ccache -z -M "${CCACHE_SIZE}"
    - CI/before_install.android.sh
    - CI/before_script.android.sh
    - cd build
    - cmake --build . -- -j $(nproc)
    - cmake --install .
    - ccache -s
  artifacts:
    paths:
308
      - build/install/