From a1aecc452361cd012e77ed4e7f1c02e3b5920bc3 Mon Sep 17 00:00:00 2001 From: Diego Juarez <45674986+iamdez99@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:28:57 -0400 Subject: [PATCH] Create CHARMS-RAS-Regression.yml --- .github/workflows/CHARMS-RAS-Regression.yml | 77 +++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/CHARMS-RAS-Regression.yml diff --git a/.github/workflows/CHARMS-RAS-Regression.yml b/.github/workflows/CHARMS-RAS-Regression.yml new file mode 100644 index 000000000..4607cf029 --- /dev/null +++ b/.github/workflows/CHARMS-RAS-Regression.yml @@ -0,0 +1,77 @@ +name: CHARMS-RAS-Regression + +on: + schedule: + # This corresponds to 6:00 AM EDT (10:00 AM UTC) + - cron: '0 10 * * *' + 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: 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_CHARMS_RAS_Regression_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::nerd-smoke-reports" + - name: Upload Cucumber Report + uses: actions/upload-artifact@v2 + if: always() + with: + name: cucumber-report-${{ github.run_number }} + path: target/nerd-smoke-reports/* + - name: Push HTML Report + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + git config --global user.email "diegojuarezbusiness@gmail.com" + git config --global user.name "iamdez99" + git stash + git fetch + git checkout gh-pages + git stash pop + mkdir -p ${{ steps.reportpath.outputs.path }} + mv target/nerd-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/.*/

NERD Smoke Test Results<\/h1>/' nerd-smoke-test-results.html + echo "

Test Report ${{ steps.reportpath.outputs.path }}/report-${{ steps.timestamp.outputs.timestamp }}.html

" >> nerd-smoke-test-results.html + git add nerd-smoke-test-results.html + git commit -m "Update nerd-smoke-test-results.html" + git push https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:gh-pages