wip: Test Travis CI for Windows
[quassel.git] / .travis.yml
1 sudo: required
2
3 services:
4   - docker
5
6 # Define a separate job for Windows
7 jobs:
8   include:
9     - os: osx
10       language: cpp
11       compiler: clang
12       env:
13       cache:
14         directories:
15           - $HOME/.ccache
16           - $HOME/Library/Caches/Homebrew
17       before_install:
18         - brew update && brew install ccache ninja qca qt5
19       script:
20         - export CCACHE_MAXSIZE=1G
21         - mkdir build && cd build
22         - |
23           PATH=$PATH:/usr/local/opt/qt5/bin
24           DEPLOY=OFF
25           if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]; then
26             DEPLOY=ON
27           fi
28           cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DDEPLOY=$DEPLOY
29           ninja install
30         - ccache -s
31         - ctest
32       deploy:
33         provider: releases
34         api_key: $GH_TOKEN
35         file_glob: true
36         file: *.dmg
37         skip_cleanup: true
38         on:
39           tags: true
40           condition: $GH_TOKEN != ''
41     - os: windows
42       language: bash
43       before_install:
44         - export TARGET=windows-msvc2017_64-cl
45         #- export GITHUB_TOKEN=$GH_TOKEN
46         - |
47           function python {
48               /C/python38/python.exe "$@"
49           }
50         - |
51           function craft {
52               python /C/CraftMaster/$TARGET/craft/bin/craft.py "$@"
53           }
54         - choco install python2
55         - choco install python3
56       install:
57         - git clone --depth=1 https://invent.kde.org/kde/craftmaster.git /C/CraftMaster/CraftMaster
58         - python /C/CraftMaster/CraftMaster/CraftMaster.py --config $TRAVIS_BUILD_DIR/.craft.ini --variables "BUILD_DIR=$TRAVIS_BUILD_DIR"
59         - craft --add-blueprint-repository https://github.com/quassel/craft-blueprints-quassel.git
60         - craft -p quassel/quassel
61         - craft nsis
62         - craft --install-deps quassel/quassel
63       script:
64         - craft --no-cache --src-dir $TRAVIS_BUILD_DIR quassel/quassel
65         - craft --no-cache --src-dir $TRAVIS_BUILD_DIR --test quassel/quassel
66       after_success:
67         - craft --no-cache --src-dir $TRAVIS_BUILD_DIR --package quassel/quassel
68         - ls $TRAVIS_BUILD_DIR/*
69         - ls $TRAVIS_BUILD_DIR/binaries/*
70       deploy:
71         provider: releases
72         api_key: $GH_TOKEN
73         file_glob: true
74         file: $TRAVIS_BUILD_DIR/binaries/*
75         skip_cleanup: true
76         on:
77           tags: true
78           condition: $GH_TOKEN != ''
79       #cache:
80       #  directories:
81       #    - $HOME/AppData/Local/Temp/chocolatey