-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (70 loc) · 3.11 KB
/
main.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
on:
workflow_dispatch:
inputs:
job:
description: 'Job to run.'
required: true
default: 'test'
jobs:
test:
runs-on: ubuntu-latest
name: "Run tests"
if: ${{ github.event.inputs.job == 'test'}}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: run basic tests
env:
APIKEY: ${{ secrets.apiKey }}
USERNAME: ${{ secrets.username }}
PASSWORD: ${{ secrets.password }}
run: |
mvn -B clean compile package -P basic -Dapplitools.apiKey=${{ secrets.apiKey }} -Dusername=${{ secrets.username }} -Dpassword=${{ secrets.password }} -DapiKey=${{ secrets.apiKey }} allure:report
find ./target/site/allure-maven-plugin/data/test-cases/ -type f -exec sed -i "s/${{ secrets.username }}/***/g" {} \;
find ./target/site/allure-maven-plugin/data/test-cases/ -type f -exec sed -i "s/${{ secrets.password }}/***/g" {} \;
find ./target/site/allure-maven-plugin/data/test-cases/ -type f -exec sed -i "s/${{ secrets.apiKey }}/***/g" {} \;
- uses: actions/upload-artifact@v1
with:
name: allure-report-basic
path: target/site
- name: run test with valid api key in 2 threads and assert single batch created
env:
APIKEY: ${{ secrets.apiKey }}
USERNAME: ${{ secrets.username }}
PASSWORD: ${{ secrets.password }}
run: |
mvn -B clean compile package -P run-tests-in-parallel-threads -Dapplitools.apiKey=${{ secrets.apiKey }} -Dusername=${{ secrets.username }} -Dpassword=${{ secrets.password }} -DapiKey=${{ secrets.apiKey }}
mvn -B compile package -Dtest=OneBatchOnParallelTest -Dapplitools.apiKey=${{ secrets.apiKey }} -Dusername=${{ secrets.username }} -Dpassword=${{ secrets.password }} -DapiKey=${{ secrets.apiKey }} allure:report
find ./target/site/allure-maven-plugin/data/test-cases/ -type f -exec sed -i "s/${{ secrets.username }}/***/g" {} \;
find ./target/site/allure-maven-plugin/data/test-cases/ -type f -exec sed -i "s/${{ secrets.password }}/***/g" {} \;
find ./target/site/allure-maven-plugin/data/test-cases/ -type f -exec sed -i "s/${{ secrets.apiKey }}/***/g" {} \;
- uses: actions/upload-artifact@v1
with:
name: allure-report-parallel-run
path: target/site
deploy:
runs-on: ubuntu-latest
name: "Deploy"
if: ${{ github.event.inputs.job == 'deploy'}}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Customize Maven repo settings
run: cp .github/workflows/settings.xml ~/.m2
- name: Install GPG key
run: echo "${{ secrets.GPG_KEY }}" | gpg --batch --import
- name: Deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
apiKey: ${{ secrets.apiKey }}
username: ${{ secrets.username }}
password: ${{ secrets.password }}
run: mvn -B deploy