language: cpp

env:
  global:
   - secure: "lm3K4g1EhB+vUzg3sj+XO6rENj7H3n8IxwDnAVi2Xd2H/J9tfPxbupdZr4o8duaXtOKOVl623KF+EhC8VRDUmWNXw4yQO1ty91kog7tOd2LRytExv6l8wj2PD6KHgMdgWNTyzYj8OynCv39fepKitSw5euRJk6eiVn+a72FCyErddZUtDyrnH+nFOSmKPULoX+qNYOhuAuIiGrksr0VbL4aDiV0AQeRr6sS0fyzqdDM+KhE8bcCMtBAWh+4uF8MVgxOTXuaZs5x8ebVJfxnOP8qR6QfHDqP0BSUOYHObqwUBUQOReD+m6RcLa+Y/O0tw8NhhiUg/3IP39ospSkIOwbPU9nTIy2w7sgtyGv8+Tc19XJ77Nn00IAPcN+Tq3Ltk++d7FEeyR4unSY9m8bOaxtOSI9cC1FT0SqkmfoP0q9ED34wq+0NAOl1jwddX+3PNC0hzeXuBOaxdC2H1JWdPmp87iRvAHAD0zO3Jkvw9ag53Pa7wlaOFb2RsAM16iVB1XPJCC0bXs6cW64NXWjsjP/8sbxy05K7vzz24c48kPrZp65MJV4AnyT/F09ttXXJnylCyTiZKeTxs9wEVWokXFZDOh6p6b4H/Vqktn6bfhDNJCnJQRiS1we5ni3lqf3Ih9Nbqa1j+51KTq80PwIzwbO6B7uCXIVxiKxw8dw/vg4M="

matrix:
  include:
  - os: osx
    name: "Build"
    osx_image: xcode11.6
    compiler: clang

    script:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/bootstrap.sh) && eval "$src" || exit 1
      - xcodebuild -jobs 1 -configuration Debug
      - xcodebuild -jobs 1 -configuration Release

    deploy:
      provider: releases
      skip_cleanup: true
      file: "build/*/*.zip"
      file_glob: true
      api_key:
        secure: nATQn/Hh/He/VJHT/F2elSrNhFxwmNhgbubLfXvi4JxojgTj+RZ8CLF2R4fNAz/GgqnEzUGmiLFqjz+ytQ6u6qAsM2YsG6DtKoVeqJoVBUlSakZ1PUI/5Ib9VZQ3vNMEE2DpXlaFKZINLBDbf7VyaWiC5bm+Lts2FIFc0BiD+EvdWHhW6zDZMbOqUxUTaGQvGEX6lqpuoOq0/f8L/o4yn+Q36cSyWyusRzZqZX6n8GtKVPLGy73DF+ywdAGd7kDJhiAfk9NgeGXqwOhyemqSqm45Dc6krI/LwIkPTzUiSZcmiL7tWLkuxKMYi1k6OBYtKFZ24yyXOC1wlODYtQ5BomxJCO2GF6cLvZhfmaupHRHkN5GSN0v76MLxSu4SvxosRVVa4rUDBIWct88e0LL3WQlclRRLEPjf6qHhEChkp5DS163uyAxLh4ue3tv7c5ebBRaG/bIF1GtjOG0dPzM0V9vLIIDkJ7tE7w+8N+DcRRXsvZyxKG3siMxTaltLhuTrwVw9/fjCer72fWjw8AgvOPbzJRUszfij7C3L7P0eJa4NrHTj1C6681smKWQXHPOhAODKGwRCvlnFjjo4srNnzq9QxnYhBiniLleBlu9mGKHA3b2Y0fHo3jdUPvlTF9fcf53+BE82RKEp9mBeQ6btSwNVAup5P7xh1fGw34laJPQ=
      on:
        tags: true

  - os: osx
    name: "Analyze Clang"
    osx_image: xcode11
    compiler: clang

    script:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/bootstrap.sh) && eval "$src" || exit 1
      - xcodebuild analyze -quiet -scheme WhateverGreen -configuration Debug CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang-analyze" && [ "$(find clang-analyze -name "*.html")" = "" ]
      - xcodebuild analyze -quiet -scheme WhateverGreen -configuration Release CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang-analyze" && [ "$(find clang-analyze -name "*.html")" = "" ]

  - os: osx
    name: "Analyze Coverity"
    osx_image: xcode10.2
    compiler: clang

    before_install:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - curl -Ls https://entrust.com/root-certificates/entrust_l1k.cer -o ~/entrust_l1k.crt || exit 1
      - curl -LS https://curl.haxx.se/ca/cacert.pem -o ~/cacert.pem || exit 1
      - cat ~/entrust_l1k.crt >> ~/cacert.pem || exit 1
      - echo "cacert=\"$HOME/cacert.pem\"" > ~/.curlrc || exit 1
      - echo "ca_certificate=$HOME/cacert.pem" > ~/.wgetrc || exit 1

    script:
      - echo "This script runs coverity..."

    addons:
      coverity_scan:
        project:
          name: "acidanthera/WhateverGreen"
          description: "WhateverGreen"
        notification_email: $NOTIFICATION_EMAIL
        build_command_prepend: "src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/bootstrap.sh) && eval \"$src\" || exit 1 ; src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/covstrap.sh) && eval \"$src\" || exit 1"
        build_command: "xcodebuild -configuration Release"
        branch_pattern: master
