name: Build

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Install Python 3
      uses: actions/setup-python@v1
      with:
        python-version: 3.6
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Run tests with pytest
      run: pytest
      
    - name: Build debug
      run: cargo build --verbose
    - name: Build release
      run: cargo build --release --verbose
    - name: Run tests
      run: cargo test --verbose
    - name: Run release tests
      run: cargo test --release --verbose
      
