language: node_js
node_js:
  - 10
  - 12
  - stable

before_install:
  - test/web-platform-tests/tests/wpt make-hosts-file | sudo tee -a /etc/hosts

install:
  - yarn --frozen-lockfile

script:
  - yarn lint
  - yarn test --retries 1

branches:
  only:
    - master

matrix:
  include:
    - node_js: 10
      env: TEST_SUITE=node-canvas
      addons:
        apt:
          packages:
            - build-essential
            - libcairo2-dev
            - libpango1.0-dev
            - libjpeg-dev
            - libgif-dev
            - librsvg2-dev
      script: "yarn add canvas && yarn test --retries 1"
    - node_js: stable
      env: TEST_SUITE=browser
      addons:
        chrome: stable
      script: "yarn test-browser"
