-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (83 loc) · 3.71 KB
/
CCT-CHAT-BOT-Smoke.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
name: PLATFORM BUSINESS - CCT CHAT BOT SMOKE TESTS
on:
schedule:
# This corresponds to 7:15 AM EST (12:15 PM UTC) from Monday to Friday
- cron: '15 12 * * MON-FRI'
workflow_dispatch:
inputs:
testBrowser:
description: 'Browser'
required: true
default: 'chrome'
jobs:
build:
runs-on: ubuntu-latest
env:
DISPLAY: ".99"
SCREEN_RESOLUTION: "1280x1024x24"
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Install Google Chrome
run: |
sudo apt-get install -y wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install -y ./google-chrome-stable_current_amd64.deb
- name: Replace variables in cloudEnv.properties
run: |
sed -i "s/SIDE_DOOR_USERNAME/${{ secrets.SIDEDOORUSERNAME }}/g" src/main/resources/conf/cloudEnv.properties
sed -i "s/SIDE_DOOR_PASSWORD/${{ secrets.SIDEDOORPASSWORD }}/g" src/main/resources/conf/cloudEnv.properties
if [ "${{ github.event_name }}" = "schedule" ]; then
sed -i "s/BROWSER_VAR/chrome/g" src/main/resources/conf/cloudEnv.properties
else
sed -i "s/BROWSER_VAR/${{ github.event.inputs.testBrowser }}/g" src/main/resources/conf/cloudEnv.properties
fi
sed -i "s/ENV_VAR/test/g" src/main/resources/conf/cloudEnv.properties
- name: Run specific runner class
run: mvn -B -q -Dtest=Run_CCT_CHAT_Smoke_Test -DisCloud=true test
continue-on-error: true
- name: Generate timestamp
id: timestamp
run: echo "::set-output name=timestamp::$(TZ='America/New_York' date +'%Y-%m-%d_%I-%M-%S_%p')"
- name: Determine report path
id: reportpath
run: echo "::set-output name=path::cct-smoke-reports"
- name: Upload Cucumber Report
uses: actions/upload-artifact@v3
if: always()
with:
name: cucumber-report-${{ github.run_number }}
path: target/cct-smoke-reports/*
- name: Remove Google Chrome installation file
run: rm google-chrome-stable_current_amd64.deb
- name: Push HTML Report
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "iamdez99"
git stash
git fetch
git checkout gh-pages
git rm -f src/main/resources/conf/cloudEnv.properties
git checkout stash -- .
mkdir -p ${{ steps.reportpath.outputs.path }}
mv target/cct-smoke-reports/*.html ${{ steps.reportpath.outputs.path }}/report-${{ steps.timestamp.outputs.timestamp }}.html
git add .
git commit -m "Publishing cucumber report ${{ github.run_number }}"
git push -f https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:gh-pages
- name: Update Test Results and Append to Index File
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
sed -i '1s/.*/<h1>CCT CHAT BOT Smoke Test Results<\/h1>/' cct-smoke-test-results.html
echo "<h3><a href='${{ steps.reportpath.outputs.path }}/report-${{ steps.timestamp.outputs.timestamp }}.html'>Test Report ${{ steps.reportpath.outputs.path }}/report-${{ steps.timestamp.outputs.timestamp }}.html</a></h3>" >> cct-smoke-test-results.html
git add cct-smoke-test-results.html
git commit -m "Update cct-smoke-test-results.html"
git push https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:gh-pages