# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

jobs:
  - job: Linux
    pool:
      vmImage: 'ubuntu-latest'
    steps:
      - script: |
          sudo apt -y update
          sudo apt install -y libxtst-dev libx11-dev libxdo3 libxdo-dev
        displayName: Install library dependencies
      - template: ci/test.yml
      - template: ci/build-linux.yml
      - template: ci/deploy.yml

  - job: UbuntuDEB
    pool:
      vmImage: 'ubuntu-latest'
    steps:
      - script: |
          sudo docker build -t espanso-ubuntu . -f ci/ubuntu/Dockerfile
          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/ci/ubuntu/build_deb.sh
        displayName: Setting up docker
      - template: ci/deploy.yml

  - job: UbuntuSNAP
    pool:
      vmImage: 'ubuntu-latest'
    steps:
      - template: ci/build-snap.yml

  - job: macOS
    pool:
      vmImage: 'macOS-10.14'
    steps:
      - template: ci/test.yml
      - template: ci/build-macos.yml
      - template: ci/deploy.yml
      - template: ci/publish-homebrew.yml

  - job: Windows
    pool:
      vmImage: 'windows-2019'
    steps:
      - template: ci/test.yml
      - template: ci/build-win.yml
      - template: ci/deploy.yml