language: c

env:
  global:
   # Coverity token
   - secure: "QFUmMNyjyhXhe+zBfGNgnrrgR9NTks90AU6BQXYCxBZm+aaRjjxkN+ITjTJeHxZJEVpqDf/gtidh6KriSWMWM2TcH+ZSsAkVym9XUdk+0Nglh/5mulp++LsbmsERhed5F4YvGS0UAcXPAAv/dESmiJY/EaDPVgXxbTFMa85c6H8="
   - COVERITY_SCAN_PROJECT_NAME=libass/libass
   - COVERITY_SCAN_NOTIFICATION_EMAIL=none@example.com
   - COVERITY_SCAN_BUILD_COMMAND="make -j2"
   - COVERITY_SCAN_BRANCH_PATTERN="master|coverity_scan"
   - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1

os:
  - linux
  - osx

compiler:
  - gcc
  - clang

jobs:
  exclude:
    - os: osx
      compiler: gcc

dist: bionic
osx_image: xcode11

branches:
  only:
    - master
    - ci
    - coverity_scan

before_script:
  - ./autogen.sh
  - ./configure
  - if [[ ${TRAVIS_JOB_NUMBER##*.} == 2 ]]; then curl -s https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | bash || true; fi
script:
  - make -j2

notifications:
  email: false
  irc:
    channels:
      # "irc.freenode.org#libass", encrypted against libass/libass to prevent IRC spam of forks
      - secure: "JcINB59M1X8kEM1fi9r4dO8yA5NkA4n7WUy9s+hufa/HiYCNO7B+r7vxIKJLKEjGWrs92iVcq9FnpDn/c2Ufrg7a0NR6JGYrg3PqgDcm0JmxvfYn7lH4cYphExz5t45Ty5oWOZivTcF+ErCt3STvU8tb/E3dUCwnpc8redWu9Mo="
    on_success: change
    on_failure: always

addons:
  apt:
    update: true
    packages:
      - libfontconfig1-dev
      - libfreetype6-dev
      - libfribidi-dev
      - libharfbuzz-dev
      - nasm
  homebrew:
    packages:
      - freetype
      - fribidi
      - nasm
      - harfbuzz
