wip: Test Travis CI for Windows
[quassel.git] / .travis.yml
index 3eac5a5..ef8102e 100644 (file)
@@ -1,11 +1,81 @@
-language: cpp
-compiler:
-  - gcc
-  - clang
+sudo: required
 
-before_install:
- - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- - sudo apt-get update -qq
- - sudo apt-get install cmake
+services:
+  - docker
 
-script: mkdir build && cd build && cmake ../ && make
+# Define a separate job for Windows
+jobs:
+  include:
+    - os: osx
+      language: cpp
+      compiler: clang
+      env:
+      cache:
+        directories:
+          - $HOME/.ccache
+          - $HOME/Library/Caches/Homebrew
+      before_install:
+        - brew update && brew install ccache ninja qca qt5
+      script:
+        - export CCACHE_MAXSIZE=1G
+        - mkdir build && cd build
+        - |
+          PATH=$PATH:/usr/local/opt/qt5/bin
+          DEPLOY=OFF
+          if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]; then
+            DEPLOY=ON
+          fi
+          cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DDEPLOY=$DEPLOY
+          ninja install
+        - ccache -s
+        - ctest
+      deploy:
+        provider: releases
+        api_key: $GH_TOKEN
+        file_glob: true
+        file: *.dmg
+        skip_cleanup: true
+        on:
+          tags: true
+          condition: $GH_TOKEN != ''
+    - os: windows
+      language: bash
+      before_install:
+        - export TARGET=windows-msvc2017_64-cl
+        #- export GITHUB_TOKEN=$GH_TOKEN
+        - |
+          function python {
+              /C/python38/python.exe "$@"
+          }
+        - |
+          function craft {
+              python /C/CraftMaster/$TARGET/craft/bin/craft.py "$@"
+          }
+        - choco install python2
+        - choco install python3
+      install:
+        - git clone --depth=1 https://invent.kde.org/kde/craftmaster.git /C/CraftMaster/CraftMaster
+        - python /C/CraftMaster/CraftMaster/CraftMaster.py --config $TRAVIS_BUILD_DIR/.craft.ini --variables "BUILD_DIR=$TRAVIS_BUILD_DIR"
+        - craft --add-blueprint-repository https://github.com/quassel/craft-blueprints-quassel.git
+        - craft -p quassel/quassel
+        - craft nsis
+        - craft --install-deps quassel/quassel
+      script:
+        - craft --no-cache --src-dir $TRAVIS_BUILD_DIR quassel/quassel
+        - craft --no-cache --src-dir $TRAVIS_BUILD_DIR --test quassel/quassel
+      after_success:
+        - craft --no-cache --src-dir $TRAVIS_BUILD_DIR --package quassel/quassel
+        - ls $TRAVIS_BUILD_DIR/*
+        - ls $TRAVIS_BUILD_DIR/binaries/*
+      deploy:
+        provider: releases
+        api_key: $GH_TOKEN
+        file_glob: true
+        file: $TRAVIS_BUILD_DIR/binaries/*
+        skip_cleanup: true
+        on:
+          tags: true
+          condition: $GH_TOKEN != ''
+      #cache:
+      #  directories:
+      #    - $HOME/AppData/Local/Temp/chocolatey