Skip to content

update README.md file #2

update README.md file

update README.md file #2

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Run tests
run: mvn -B test --file pom.xml
- name: Generate test report
if: always()
run: |
mkdir -p test-results
find . -type f -path "*/target/surefire-reports/*.xml" -exec cp {} test-results/ \;
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/*.xml
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: target/surefire-reports/
integration-test:
name: Run Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Run integration tests
run: mvn -B test -Dtest="*IntegrationTest" --file pom.xml
- name: Upload integration test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-reports
path: target/surefire-reports/
build:
name: Build Application
runs-on: ubuntu-latest
needs: [test, integration-test]
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B clean package -DskipTests --file pom.xml
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: library-management-jar
path: target/*.jar
retention-days: 7