-
-
Notifications
You must be signed in to change notification settings - Fork 81
201 lines (181 loc) · 9.5 KB
/
gradle.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Vividus CI
on:
push:
branches:
- master
tags:
- release-[0-9]+.[0-9]+.[0-9]+
pull_request:
branches:
- master
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout (including submodules and tags)
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Cache ~/.gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Cache ~/.gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('vividus-build-system/**/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Cache tests history
if: github.ref == 'refs/heads/master' && matrix.platform == 'ubuntu-latest'
uses: pat-s/always-upload-cache@v1.1.4
with:
path: vividus-tests/output/history
key: tests-history-cache-${{ github.sha }}
restore-keys: |
tests-history-cache-
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Build with Gradle
env:
MATRIX_PLATFORM: ${{ matrix.platform }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: bash
run: |
if [[ $MATRIX_PLATFORM = "ubuntu-latest" ]]; then
if [[ -n $SONAR_TOKEN ]]; then
./gradlew build sonarqube -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=vividus -Dsonar.projectKey=vividus-framework_vividus -Dorg.gradle.jvmargs="-Xmx2g -XX:MaxMetaspaceSize=768m"
else
echo No SONAR_TOKEN, SonarQube analysis will be skipped
./gradlew build -Dorg.gradle.jvmargs="-Xmx2g -XX:MaxMetaspaceSize=768m"
fi
else
./gradlew build --no-daemon
fi
- name: Publish unit and integration tests reports - ${{ matrix.platform }}
if: always()
uses: actions/upload-artifact@v1
with:
name: Unit and Integration Tests - Reports - ${{ matrix.platform }}
path: vividus/output/reports/tests
- name: Upload coverage to Codecov
if: matrix.platform == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
- name: Integration tests
if: matrix.platform == 'ubuntu-latest'
run: |
./gradlew :vividus-tests:runStories -Pvividus.configuration.environments=integration \
-Pvividus.allure.history-directory=output/history/integration-tests \
-Pvividus.allure.executor.name="Github Actions (Vividus)" \
-Pvividus.allure.executor.type=github \
-Pvividus.allure.executor.url=https://github.com/vividus-framework/vividus/actions \
-Pvividus.allure.executor.build-order=${GITHUB_RUN_ID} \
-Pvividus.allure.executor.build-name="Integration Tests ${GITHUB_RUN_ID}" \
-Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
-Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
-Pvividus.allure.executor.report-name="Integration tests report"
- name: Publish Integration tests report
if: matrix.platform == 'ubuntu-latest' && always()
uses: actions/upload-artifact@v1
with:
name: Integration Tests - Allure report - ${{ matrix.platform }}
path: vividus-tests/output/reports/allure
- name: System tests
if: matrix.platform == 'ubuntu-latest'
env:
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
APPLITOOLS_EXECUTE_KEY: ${{ secrets.APPLITOOLS_EXECUTE_KEY }}
APPLITOOLS_READ_KEY: ${{ secrets.APPLITOOLS_READ_KEY }}
MONGODB_USERNAME: ${{ secrets.MONGODB_USERNAME }}
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
shell: bash
run: |
if [[ -n $BROWSERSTACK_USER && -n $BROWSERSTACK_KEY && -n $APPLITOOLS_READ_KEY && -n $APPLITOOLS_READ_KEY && -n $MONGODB_USERNAME && -n $MONGODB_PASSWORD ]]; then
./gradlew :vividus-tests:runStories -Pvividus.configuration.environments=system \
-Pvividus.configuration.suite=system \
-Pvividus.configuration.profiles=browserstack/web,web/desktop/chrome \
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
-Pvividus.allure.history-directory=output/history/system-tests \
-Pvividus.allure.executor.name="Github Actions (Vividus)" \
-Pvividus.allure.executor.type=github \
-Pvividus.allure.executor.url=https://github.com/vividus-framework/vividus/actions \
-Pvividus.allure.executor.build-order=${GITHUB_RUN_ID} \
-Pvividus.allure.executor.build-name="System Tests ${GITHUB_RUN_ID}" \
-Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
-Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
-Pvividus.allure.executor.report-name="System tests report"
else
echo No BROWSERSTACK_USER and/or BROWSERSTACK_KEY and/or APPLITOOLS_EXECUTE_KEY and/or APPLITOOLS_READ_KEY and/or MONGODB_USERNAME and/or MONGODB_PASSWORD variables, System tests will be skipped
fi
- name: Publish System tests report
if: matrix.platform == 'ubuntu-latest' && always()
uses: actions/upload-artifact@v1
with:
name: System Tests - Allure report - ${{ matrix.platform }}
path: vividus-tests/output/reports/allure
- name: Browserstack Integration
if: matrix.platform == 'ubuntu-latest'
env:
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
shell: bash
run: |
if [[ -n $BROWSERSTACK_USER && -n $BROWSERSTACK_KEY ]]; then
declare -a profiles=( iexplore chrome firefox edge )
for profile in "${profiles[@]}"; do
./gradlew runStories -Pvividus.configuration.environments=grid \
-Pvividus.configuration.suite=grid \
-Pvividus.configuration.profiles=browserstack/web,web/desktop/${profile} \
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY}
done
else
echo No BROWSERSTACK_USER and/or BROWSERSTACK_KEY, Browserstack integration tests will be skipped
fi
- name: SauceLabs Integration
if: matrix.platform == 'ubuntu-latest'
env:
SAUCELABS_USER: ${{ secrets.SAUCELABS_USER }}
SAUCELABS_KEY: ${{ secrets.SAUCELABS_KEY }}
shell: bash
run: |
if [[ -n $SAUCELABS_USER && -n $SAUCELABS_KEY ]]; then
declare -a profiles=( iexplore chrome firefox edge )
for profile in "${profiles[@]}"; do
./gradlew runStories -Pvividus.configuration.environments= \
-Pvividus.configuration.suite=grid \
-Pvividus.configuration.profiles=saucelabs/web,web/desktop/${profile} \
-Pvividus.selenium.grid.username=${SAUCELABS_USER} \
-Pvividus.selenium.grid.password=${SAUCELABS_KEY}
done
else
echo No SAUCELABS_USER and/or SAUCELABS_KEY, SauceLabs integration tests will be skipped
fi
- name: Publish Snapshot Artifacts
if: github.ref == 'refs/heads/master' && matrix.platform == 'ubuntu-latest'
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
run: ./gradlew artifactoryPublish -Dartifactory.publish.contextUrl=http://oss.jfrog.org -Dartifactory.publish.repoKey=oss-snapshot-local -Dartifactory.publish.username=$BINTRAY_USER -Dartifactory.publish.password=$BINTRAY_KEY -Dartifactory.publish.buildInfo=false
- name: Publish Release Artifacts
if: startsWith(github.ref, 'refs/tags/release-') && matrix.platform == 'ubuntu-latest'
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
run: ./gradlew bintrayUpload -Dbintray.user=$BINTRAY_USER -Dbintray.key=$BINTRAY_KEY