name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - 1.31.1
          - stable
          - beta
        pandoc:
          - 2.13
        include:
          - pandoc: 2.14.0.1
            pandoc_url: https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb
            rust: stable
          - pandoc: 2.13
            pandoc_url: https://github.com/jgm/pandoc/releases/download/2.13/pandoc-2.13-1-amd64.deb
          - pandoc: 2.12
            pandoc_url: https://github.com/jgm/pandoc/releases/download/2.12/pandoc-2.12-1-amd64.deb
            rust: stable
    steps:
    - name: Download and install Pandoc ${{ matrix.pandoc }}
      run: curl -L ${{ matrix.pandoc_url }} --output pandoc-amd64.deb && 
           sudo dpkg -i pandoc-amd64.deb
    - uses: actions/checkout@v2
    - name: Build
      run: cargo build --verbose
    - name: Run tests
      run: cargo test --verbose
