Skip to content

Run the automation batch #11

Run the automation batch

Run the automation batch #11

name: Run the automation batch
on: workflow_dispatch
jobs:
build:
name: run-workflow
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven
- name: Authenticate to GitHub Packages
run: |
echo "<settings><servers><server><id>github</id><username>${{ github.actor }}</username><password>${{ secrets.GITHUB_TOKEN }}</password></server></servers></settings>" > ~/.m2/settings.xml
# Create the report directory if it does not exist
- name: Create report folder
run: mkdir -p extent.reports
- name: Run Rest Assured Test Cases
run: mvn clean test -X # Enable Maven debug output for more details
# Debugging step to list all files in the workspace
- name: List all files in the workspace (for debugging)
run: find . -type f
# Upload Surefire test reports for debugging
- name: Upload Surefire Reports
if: always() # Run this step even if the tests fail
uses: actions/upload-artifact@v3
with:
name: surefire-reports
path: target/surefire-reports/
- name: Archive TestNG Reports
if: always() # This ensures the step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: extent-reports
path: ./extent.reports/ # Update this path if your reports are stored elsewhere