forked from freeorion/freeorion
/
.travis.yml
167 lines (157 loc) · 5.15 KB
/
.travis.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
stages:
- lint
- build
- test
_linux_setup_common: &_linux_setup_common
os: linux
dist: bionic
language: cpp
cache: ccache
before_install:
# timeout before Travis kills jobs so that ccache is always at least partially populated
- >
function cmake {
timeout 45m cmake $@
}
install:
# The build cache for a full project build currently packs around 340M
# in combination wit a bug in ccache before 3.4.2 prematurely cleaned
# the cache if it was filled up to 80%. Therefor raise the cache size
# to 500MB
- ccache --set-config=max_size=500M --set-config=sloppiness=file_macro
- ccache --zero-stats
- >
sudo apt-get install --assume-yes
libboost1.62-all-dev
libglew-dev
libogg-dev
libopenal-dev
libsdl2-dev
libvorbis-dev
cppcheck
doxygen
python3-pip
- python3 -m pip install flake8==3.7.9
before_script:
- mkdir build
- cd build
after_success:
- cmake --build . --config Release --target unittest
before_cache:
- ccache --cleanup
- ccache --show-stats
_test_python_common: &_test_python_common
stage: test
os: linux
dist: bionic
language: python
install:
- pip install pytest==5.4.1
script:
- pytest
jobs:
include:
- name: Lint AI with Python 3.5
<<: *_linux_setup_common
stage: lint
script:
- cmake ..
- cmake --build . --target check-pep8
- name: Lint string tables
stage: lint
os: linux
dist: bionic
language: python
python: 3.5
script:
- ./check/st-tool.py check --reference default/stringtables/en.txt default/stringtables/*.txt
- diff -u default/stringtables/en.txt <(check/st-tool.py format default/stringtables/en.txt) || { echo "String table is not properly formatted"; exit 1; }
- name: Build C++ API documentation
<<: *_linux_setup_common
stage: build
env:
# Auth token to push API documentation
- secure: "JKeXk8p65hodb12PVRST6A90swsNubc+46EbSJGSghldIxbFWLBAlwU+KLeOMO4V0veu6k4lnMa50V0UYFZmoUsS6W0aL5Ybo98SpzXHiNLOmOluoqJoF9TBsOTCCRFbWbccgJyVEtulgRcdml96naS51lq9Sw/VO/N3Z472304="
script:
- cmake ..
- cmake --build . --target cpp-apidoc
before_deploy:
# Configure git to use the identity of FreeOrion Build Bot and
# load credentials
- git config --global user.email "freeorionorg@gmail.com"
- git config --global user.name "FreeOrion Build Bot"
- git config --global credential.helper "cache --timeout=300"
- echo -e "url=https://freeorion-bot:${FreeOrion_AUTH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git\n" | git credential approve
- git clone --depth=1 --branch=master https://github.com/freeorion/freeorion.github.io.git apidoc-deploy.git
- pushd apidoc-deploy.git
- rm -rf cppapi/master
- mkdir -p cppapi/master
- cp -R ../doc/cpp-apidoc/html cppapi/master
- git add -A cppapi/master
- git commit -m "Update FreeOrion API documentation to match commit \`$(date --iso-8601).${TRAVIS_COMMIT:0:8}\`" || true
deploy:
provider: script
script: git push https://github.com/freeorion/freeorion.github.io.git master:master
skip_cleanup: true
on:
branch: master
- name: Build FreeOrion on Ubunutu 18.04 (Bionic)
<<: *_linux_setup_common
stage: build
env:
- CACHE_NAME=linux-full
- CMAKE_BUILD_PARALLEL_LEVEL=2
script:
- cmake -DBUILD_TESTING=ON ..
- cmake --build .
- name: Build headless FreeOrion on Ubunutu 18.04 (Bionic)
<<: *_linux_setup_common
stage: build
env:
- CACHE_NAME=linux-headless
- CMAKE_BUILD_PARALLEL_LEVEL=2
script:
- cmake -DBUILD_CLIENT_GG=OFF -DBUILD_TESTING=ON ..
- cmake --build .
- name: Build FreeOrion on MacOS
stage: build
os: osx
osx_image: xcode9.4
language: cpp
compiler: clang
cache: ccache
env:
- CACHE_NAME=macos-full
- CMAKE_BUILD_PARALLEL_LEVEL=2
- HOMEBREW_NO_AUTO_UPDATE=1
before_install:
- export PATH="/usr/local/opt/ccache/libexec:$PATH"
# timeout before Travis kills jobs so that ccache is always at least partially populated
- >
function cmake {
/usr/local/bin/gtimeout 40m /usr/local/bin/cmake $@
}
install:
- brew install ccache
- ccache --set-config=max_size=500M --set-config=sloppiness=file_macro
- ccache --zero-stats
before_script:
- mkdir build
- cd build
script:
- cmake -GXcode -DBUILD_TESTING=OFF -DBoost_NO_BOOST_CMAKE=ON -DGLEW_USE_STATIC_LIBS=ON ..
- cmake --build . --config Release -- -parallelizeTargets
before_cache:
- ccache --cleanup
- ccache --show-stats
- name: Unittest AI with Python 3.5
<<: *_test_python_common
python: 3.5
before_install:
- alias pip=/usr/bin/pip3
- name: Unittest AI with Python 3.8
<<: *_test_python_common
python: 3.8
before_install:
- alias pip=/usr/bin/pip3