fatiando/rockhound

View on GitHub
.azure-pipelines.yml

Summary

Maintainability
Test Coverage
# Configuration for Azure Pipelines
########################################################################################

# Only build the master branch, tags, and PRs (on by default) to avoid building random
# branches in the repository until a PR is opened.
trigger:
  branches:
    include:
    - master
    - refs/tags/*

# Make sure triggers are set for PRs to any branch.
pr:
  branches:
    include:
    - '*'


jobs:

# Style Checks on Linux
########################################################################################
- job:
  displayName: 'Style Checks'

  pool:
    vmImage: 'ubuntu-16.04'

  variables:
    CONDA_INSTALL_EXTRA: "black flake8 pylint==2.4.*"
    PYTHON: '3.7'

  steps:

  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.7'

  - bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
    displayName: Add conda to PATH

  # Get the Fatiando CI scripts
  - bash: git clone --branch=1.2.0 --depth=1 https://github.com/fatiando/continuous-integration.git
    displayName: Fetch the Fatiando CI scripts

  # Setup dependencies and build a conda environment
  - bash: source continuous-integration/azure/setup-miniconda.sh
    displayName: Setup Miniconda

  # Show installed pkg information for postmortem diagnostic
  - bash: |
      set -x -e
      source activate testing
      conda list
    displayName: List installed packages

  # Check that the code passes format checks
  - bash: |
      set -x -e
      source activate testing
      make check
    displayName: Formatting check (black and flake8)
    condition: succeededOrFailed()

  # Check that the code passes linting checks
  - bash: |
      set -x -e
      source activate testing
      make lint
    displayName: Linting (pylint)
    condition: succeededOrFailed()