matrix:
  include:
    - name: "Linux (glibc) - Node 8"
      os: linux
      dist: trusty
      sudo: false
      language: node_js
      node_js: "8"
    - name: "Linux (glibc) - Node 10"
      os: linux
      dist: trusty
      sudo: false
      language: node_js
      node_js: "10"
    - name: "Linux (glibc) - Node 12"
      os: linux
      dist: trusty
      sudo: false
      language: node_js
      node_js: "12"
      after_success:
        - npm install coveralls
        - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
    - name: "Linux (musl) - Node 8"
      os: linux
      dist: trusty
      sudo: true
      language: minimal
      before_install:
        - sudo docker run -dit --name sharp --env CI --env PREBUILD_TOKEN --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:8-alpine
        - sudo docker exec sharp apk add build-base git python2 --update-cache
      install: sudo docker exec sharp sh -c "npm install --unsafe-perm"
      script: sudo docker exec sharp sh -c "npm test"
    - name: "Linux (musl) - Node 10"
      os: linux
      dist: trusty
      sudo: true
      language: minimal
      before_install:
        - sudo docker run -dit --name sharp --env CI --env PREBUILD_TOKEN --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:10-alpine
        - sudo docker exec sharp apk add build-base git python2 --update-cache
      install: sudo docker exec sharp sh -c "npm install --unsafe-perm"
      script: sudo docker exec sharp sh -c "npm test"
    - name: "Linux (musl) - Node 12"
      os: linux
      dist: trusty
      sudo: true
      language: minimal
      before_install:
        - sudo docker run -dit --name sharp --env CI --env PREBUILD_TOKEN --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:12.0-alpine
        - sudo docker exec sharp apk add build-base git python2 --update-cache
      install: sudo docker exec sharp sh -c "npm install --unsafe-perm"
      script: sudo docker exec sharp sh -c "npm test"
    - name: "OS X - Node 8"
      os: osx
      osx_image: xcode9.2
      language: node_js
      node_js: "8"
    - name: "OS X - Node 10"
      os: osx
      osx_image: xcode9.2
      language: node_js
      node_js: "10"
    - name: "OS X - Node 12"
      os: osx
      osx_image: xcode9.2
      language: node_js
      node_js: "12"
