-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
76 lines (60 loc) · 2.01 KB
/
azure-pipelines.yml
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 Django
# Test a Django project on multiple versions of Python.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
- '*'
variables:
CI: 'true'
nodeVersion: '10.x'
pythonVersion: '3.7'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(nodeVersion)
- script: npm install
workingDirectory: frontend
displayName: 'npm install'
- script: npm run build
workingDirectory: frontend
displayName: 'npm build'
- script: npm run test
workingDirectory: frontend
displayName: 'npm tests'
- task: UsePythonVersion@0
inputs:
versionSpec: $(pythonVersion)
architecture: 'x64'
- script: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install unittest-xml-reporting
displayName: 'pip install'
- script: |
python manage.py collectstatic
displayName: 'django collectstatic'
- script: |
python manage.py test --testrunner xmlrunner.extra.djangotestrunner.XMLTestRunner --no-input --debug-mode
displayName: 'python tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: "**/TEST-*.xml"
- powershell: |
Add-Type -assembly "system.io.compression.filesystem"
$source = '$(Build.SourcesDirectory)'
$destination = Join-Path '$(Build.ArtifactStagingDirectory)' -ChildPath T13Site.zip
$exclude = @("node_modules")
$files = Get-ChildItem -Path $source -Exclude $exclude
Compress-Archive -Path $files -DestinationPath $destination -CompressionLevel Fastest
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'copy build artifacts'
- task: PublishBuildArtifacts@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'publish build artifacts'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'sources'
parallel: true