forked from microsoft/CyberBattleSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathado-ci.yml
More file actions
76 lines (62 loc) · 2.12 KB
/
Copy pathado-ci.yml
File metadata and controls
76 lines (62 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
#
# Adapted from the template available here https://github.com/microsoft/azure-pipelines-yaml/blob/master/templates/python-package.yml
trigger:
- master
pool:
vmImage: "ubuntu-latest"
strategy:
matrix:
Python39:
python.version: "3.9"
steps:
- checkout: self
submodules: false # does not work event though it's supposed to (authentication issue)
persistCredentials: false
- task: UsePythonVersion@0
name: pythonver
inputs:
versionSpec: "$(python.version)"
displayName: "Use Python $(python.version)"
- task: NodeTool@0
inputs:
versionSpec: "12.x"
#checkLatest: false # Optional
displayName: "Use node tools"
- script: |
cat apt-requirements.txt | xargs sudo apt install
displayName: "Install apt dependencies"
- script: |
python -m pip install flake8==5.0.1
displayName: "Lint with flake8"
- task: Cache@2
displayName: "Pull pip packages from cache"
inputs:
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements.dev.txt') }}-setup.py
restore-keys: pip-${{ runner.os }}
path: $(pythonver.pythonLocation)/lib/python3.9/site-packages
- script: |
./install-pythonpackages.sh
displayName: "Pull pip dependencies"
- script: |
./pyright.sh --version
displayName: "Install pyright"
- task: Cache@2
displayName: "Pull typing stubs from cache"
inputs:
key: typingstubs-${{ runner.os }}-${{ hashFiles('createstubs.sh') }}
restore-keys: typingstubs-${{ runner.os }}-${{ hashFiles('createstubs.sh') }}
path: typings/
- script: |
./createstubs.sh
displayName: "create type stubs"
- script: |
./pyright.sh
displayName: "Typecheck with pyright"
- script: |
pip install pytest-azurepipelines
python -m pytest -v cyberbattle
displayName: "Test with pytest"