Update .gitignore #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run API Tests & Publish Allure Report | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: # Allows manual execution | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v4 # Latest version | |
# Step 2: Set up the latest Java version (Java 21) | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 # Latest version | |
with: | |
distribution: 'temurin' # Eclipse Temurin JDK (recommended) | |
java-version: '21' | |
cache: 'maven' | |
# Step 3: Build and Run API Tests | |
- name: Run build | |
run : mvn clean install | |
- name: Run API Tests | |
run : mvn clean test | |
# Step 4: Generate Allure Report | |
- name: Generate Allure Report | |
run: mvn allure:report | |
- name: Verify Report Directory | |
run: | | |
ls -la target/site/allure-maven-plugin | |
test -f target/site/allure-maven-plugin/index.html || exit 1 | |
# Step 5: Deploy Allure Report to GitHub Pages | |
- name: Deploy Allure Report to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 # Latest version | |
with: | |
branch: master | |
folder: target/site/allure-maven-plugin | |
clean: true # Ensures only the latest report is kept |