Skip to content

first commit

first commit #5

Workflow file for this run

#
#name: Selenium TestNG CI
#
#on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
#
#jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# # Step 1: Checkout the code
# - name: Checkout repository
# uses: actions/checkout@v2
#
# # Step 2: Set up Java environment
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# distribution: 'adopt'
# java-version: '11'
#
# # Step 3: Cache Maven dependencies for faster builds
# - name: Cache Maven dependencies
# uses: actions/cache@v2
# with:
# path: ~/.m2
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
#
# # Step 4: Install Maven dependencies
# - name: Install dependencies
# run: mvn install -DskipTests
#
# # Step 5: Run TestNG tests
# - name: Run TestNG tests
# run: mvn test
#
# # Step 6: Generate Extent Reports (optional)
# - name: Upload TestNG Extent Reports
# uses: actions/upload-artifact@v2
# with:
# name: extent-reports
# path: target/extent-reports/ # Adjust this path to your reports folder
name: Selenium TestNG CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code
- name: Checkout repository
uses: actions/checkout@v2
# Step 2: Set up Java environment
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
# Step 3: Cache Maven dependencies for faster builds
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Step 4: Install Maven dependencies
- name: Install dependencies
run: mvn install -DskipTests
# Step 5: Run TestNG tests
- name: Run TestNG tests
run: mvn test
# Step 6: Upload Extent Reports (updated to use v3)
- name: Upload TestNG Extent Reports
uses: actions/upload-artifact@v3
with:
name: extent-reports
path: target/extent-reports/ # Adjust this path to your reports folder