language: cpp

env:
  global:
   - secure: "Sw+oy0sRH0gaPGMd6drJ47OwJ8e3U8TVPm7ZAZ3ZEJ9ghOHdxOf53/101ZfueKmCwpqEzsfj5Wu1kA8fm75mDmzrSDbGZk4HGBLlMDgUh4W08EhM8yJp52C7036yHyWxKc4J4IZ+hCLivfXs4a5yTow2I6pS9hZMEwhDTxxxXYBeknht1HNLm2zRHJ3uizApPP90EgxHOj9hRvy9YUdt6KwTYizzRssuw6cxUINo8Ct1dNvhs1aD/QkscUymAaA6UXMU6S2SGjOBVMiAej7kXy99cFpII1C9GwxLfE3JGUuVq6yAuLe1BL6ZKCi7Kp59VNoLXsSCuvQuddQ8CryzfaMdrx/ksX2M99EiJMY25zsYmYewE+1rHAF3MjzyodF0X/sz88m6fZBapfBVTimQuv+PjgjqFV9splFlmrMDFCR3rMsX/bDqLGFX3eDoBeDsHaQLzQOGjG6nG+c3HYEblbUCCATBeQJ3upGtGYkFvlpLgOwwJs/5oDH7KOFAwPTBgP+AqqrJP6TrvBvj/5YcDDj47DYeU43ptWNouTniNtFc85AwqiYCdYvaxyQA5r3iO5yBHnkBMN0Ph9kVXlZ1IzOHmTRhhMYSWIZHl1ZP4/D6YgS2zO+YCAINkXB+jMJwYQTduFvKEPiyGY0UO5OXojQAaXy4dtawkkz4rqs0RCo="

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

    script:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - 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: cXnUEbDAuHaL6XcN4qazrgAnAc4sqVXYzXX/GedJlaulWgrovLeUGEBqNEshodXPD+DJWcpVVZQgvrYHW9BsQfcZLWNXM4XfAbpN2FC36Y+KDNVXwjI1WRiIeDO7jr6DPnH+49Nrl1c/zvPKjKHOiuJVurBPf3A/KIQeOfcW5AYFH+gDuVIw0tplfdjVgFEAJ6/kmZ41P1cgO2oEe/O8+TdfvwOuIMfbNTgxyDQatR6HNYwPfcUCEB6GyG/DPu9Sc6ia/K8nGlfJzOPGIsjjhObnTGX9hMw4IGaUv5+15w8ounj2D2erEnEk5k7RaWCx2jx/aviKZ7+vokNuL0sRCZeuzYCrSaXp4MkAb2Ak/dVcIcXV9cVKowS3+9jt04RdPtBi6s0dCcK+82akJq/8irUnX1Hr+5tCI5uKOGdRhMSvjsD1dc3Vp40kbnGa0WwtRXonTuuIJ6rOchdIitUxADMhxngx0xop+M4nUeprLHcXQcWEN2kDKdAEBaNW68QcugZcOK+PqeMHC/kYdiuo/i0hJ6KEZm3GLf6IY/83Mhz5hqBoL4wqpjlucS5BnxCnRH8vPJqi3gDE2YpTM/XhUxQ6LLRiWMcWHHXdfeOBajtf5HVTiM6R50qUbUWcbhIFhrIiCQQJHewJHQWBDzIVdp7S698Jsofihi73nf9fue4=
      on:
        tags: true

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

    script:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - xcodebuild analyze -quiet -scheme Lilu -configuration Debug CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang-analyze" && [ "$(find clang-analyze -name "*.html")" = "" ]
      - xcodebuild analyze -quiet -scheme Lilu -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/Lilu"
          description: "Lilu"
        notification_email: $NOTIFICATION_EMAIL
        build_command_prepend: "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
