-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
102 lines (86 loc) · 2.48 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
trigger: none
variables:
- name: allure
value: 2.29.0
readonly: true
- name: EXECUTOR_NAME
value: "Azure DevOps"
readonly: true
- name: EXECUTOR_TYPE
value: "azure"
readonly: true
parameters:
- name: browser
displayName: The browser to test
type: string
default: firefox
values:
- chrome
- chromium
- firefox
- msedge
stages:
- stage: test
jobs:
- job: test
pool:
vmImage: 'ubuntu-latest'
container: harmin/qa-runner:latest
steps:
- script: |
export PATH=$PATH:$HOME/.local/bin
python3 -m venv ~/venv
. ~/venv/bin/activate
./runner.sh --browser ${{ parameters.browser }}
./serenity.sh --browser ${{ parameters.browser }}
CI_JOB_URL=$(System.CollectionUri)$(Build.Repository.Name)/_build/results?buildId=$(Build.BuildId)"&view=logs"
echo $CI_JOB_URL > reporting/allure-results/java/job.url
echo $CI_JOB_URL > reporting/allure-results/nodejs/job.url
echo $CI_JOB_URL > reporting/allure-results/python/job.url
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: 'reporting'
artifactName: reporting
- stage: report
dependsOn: test
jobs:
- job: allure
pool:
vmImage: 'ubuntu-latest'
container: openjdk:8-jre
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'reporting'
downloadPath: './'
- script: |
curl https://github.com/allure-framework/allure2/releases/download/${{ variables.allure }}/allure-${{ variables.allure }}.zip -L -o /tmp/allure.zip
unzip /tmp/allure.zip -d /tmp/
mv /tmp/allure-${{ variables.allure }} /tmp/allure
./allure.sh --browser ${{ parameters.browser }}
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: 'reporting'
artifactName: reporting
- stage: commit
dependsOn: report
jobs:
- job: commit
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'reporting'
downloadPath: './'
- script: |
git config --global user.name "Azure DevOps"
git config --global user.email "[email protected]"
git clone https://Personal%20Access%20Token:$(token)@dev.azure.com/harmin-parra/reports/_git/reports
cd reports
git rm -r report-*
mv ../reporting/report-* ./
mv ../reporting/allure-reports/report-* ./
git add *
git commit -m "Azure DevOps commit"
git push