Set up CI with Azure Pipelines

[skip ci]
This commit is contained in:
Marc Brockschmidt 2021-08-17 13:29:20 +01:00
Родитель 8d0330ff3f
Коммит 0921ad0fc1
1 изменённых файлов: 45 добавлений и 0 удалений

45
azure-pipelines.yml Normal file
Просмотреть файл

@ -0,0 +1,45 @@
trigger:
- main
pool:
vmImage: ubuntu-latest
strategy:
matrix:
Python37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: |
conda env create --file environment.yml
conda init bash
source activate fsmol
pip install flake8==3.8.3 black==20.8b1
conda deactivate
displayName: Create Anaconda environment with all dependencies
condition: succeeded()
- bash: |
source activate fsmol
# Run black
black --check --diff .
if [ $? -ne 0 ]; then
exit 1
fi
# Run flake8
flake8
if [ $? -ne 0 ]; then
exit 1
fi
conda deactivate
condition: succeeded()
displayName: Run black, flake8