-
Notifications
You must be signed in to change notification settings - Fork 37
/
.travis.yml
57 lines (51 loc) · 1.6 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
language: cpp
jobs:
include:
- os: linux
dist: focal
arch: amd64
compiler: gcc
env:
- EXECUTABLE="./build/release/PenguinSubtitlePlayer"
addons:
apt:
packages:
- qt5-default
- qttools5-dev-tools
- clang-format
- ca-certificates
- os: osx
osx_image: xcode12.5
arch: amd64
compiler: clang
env:
- HOMEBREW_NO_AUTO_UPDATE=1
- EXECUTABLE="./build/release/PenguinSubtitlePlayer.app/Contents/MacOS/PenguinSubtitlePlayer"
addons:
homebrew:
packages:
- qt5
- clang-format
git:
submodules: false
cache:
directories:
- $HOME/Library/Caches/Homebrew
before_cache:
- brew cleanup
before_install:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo update-ca-certificates; fi
- git submodule update --init --recursive
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew link qt5 --force; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew link clang-format --force; fi
script:
- clang-format -version
- find . -path "./src/uchardet" -prune -o -path "./build" -prune -o \( -name '*.h' -o -name '*.cpp' \) -print | xargs clang-format -style=file -output-replacements-xml | grep -q '<replacement '; test $? -eq 1
- qmake --version
- $CXX --version
- qmake "CONFIG+=test" "QMAKE_CXX=$CXX" "QMAKE_CC=$CC" PenguinSubtitlePlayer.pro # compile for unit test first
- make -j2
- $EXECUTABLE # run unit test
- make clean
- qmake "QMAKE_CXX=$CXX" "QMAKE_CC=$CC" PenguinSubtitlePlayer.pro # compile for actual program
- make -j2