-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (65 loc) · 2.83 KB
/
CHARMS-RAS-Regression.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
name: CHARMS-RAS-REGRESSION
on:
schedule:
# This corresponds to 8:00 AM EDT (1:00 AM UTC) from Monday to Friday
- cron: '0 13 * * MON-FRI'
workflow_dispatch:
inputs:
testBrowser:
description: 'Browser'
required: true
default: 'chrome'
jobs:
build:
runs-on: NCI-WINDOWS
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Run specific runner class
run: mvn -B -q -Dtest=ServiceNow.CHARMS.Runners.Run_CHARMS_RAS_Regression_Test test
continue-on-error: true
- name: Generate timestamp
id: timestamp
run: echo "timestamp=$(TZ='America/New_York' date +'%Y-%m-%d_%I-%M-%S_%p')" >> $GITHUB_ENV
- name: Determine report path
id: reportpath
run: echo "path=html-charms-rasopathy-regression-reports" >> $GITHUB_ENV
- name: Upload Cucumber Report
uses: actions/upload-artifact@v4
if: always()
with:
name: CHARMS-RAS-REGRESSION-${{ env.timestamp }}
path: target/html-charms-rasopathy-regression-reports/*
- 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 checkout stash -- .
mkdir -p ${{ env.path }}
mv target/html-charms-rasopathy-regression-reports/*.html ${{ env.path }}/report-${{ env.timestamp }}.html
git add .
git commit -m "Publishing cucumber report ${{ env.timestamp }}"
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: |
if [[ -f "charms-ras-test-results.html" ]]; then
sed -i '1s/.*/<h1>CHARMS RAS Test Results<\/h1>/' charms-ras-test-results.html
echo "<h3><a href='${{ env.path }}/report-${{ env.timestamp }}.html'>Test Report ${{ env.path }}/report-${{ env.timestamp }}.html</a></h3>" >> charms-ras-test-results.html
git add charms-ras-test-results.html
git commit -m "Update charms-ras-test-results.html"
else
echo "<h1>CHARMS RAS Test Results</h1>" > charms-ras-test-results.html
echo "<h3><a href='${{ env.path }}/report-${{ env.timestamp }}.html'>Test Report ${{ env.path }}/report-${{ env.timestamp }}.html</a></h3>" >> charms-ras-test-results.html
git add charms-ras-test-results.html
git commit -m "Create and update charms-ras-test-results.html"
fi
git push https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:gh-pages