mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
Added artifacts
This commit is contained in:
parent
291086370b
commit
3f9db9d81e
1 changed files with 27 additions and 26 deletions
53
.github/workflows/ci.yml
vendored
53
.github/workflows/ci.yml
vendored
|
@ -2,11 +2,9 @@ name: CI Pipeline
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [ main ]
|
||||||
- main
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches: [ main ]
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -14,37 +12,40 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
|
|
||||||
- name: Cache Maven dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.m2/repository
|
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-maven-
|
|
||||||
|
|
||||||
- name: Set up PostgreSQL
|
|
||||||
uses: harmon758/postgresql-action@v1.0.0
|
|
||||||
with:
|
|
||||||
postgresql version: '13'
|
|
||||||
postgresql db: 'petclinic'
|
|
||||||
postgresql user: 'postgres'
|
|
||||||
postgresql password: 'password'
|
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn clean install
|
run: mvn clean install
|
||||||
|
|
||||||
- name: Run tests
|
- name: Upload Build Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-artifacts
|
||||||
|
path: target/**
|
||||||
|
|
||||||
|
- name: Run Unit Tests
|
||||||
run: mvn test
|
run: mvn test
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Upload Test Reports
|
||||||
run: docker build -t petclinic-app .
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: test-reports
|
||||||
|
path: target/surefire-reports/**
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Generate Code Coverage Report
|
||||||
run: docker push your-dockerhub-username/petclinic-app
|
run: mvn jacoco:report
|
||||||
|
|
||||||
|
- name: Upload Code Coverage Report
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: code-coverage-report
|
||||||
|
path: target/site/jacoco/**
|
||||||
|
|
||||||
|
- name: Run Deployment
|
||||||
|
run: java -jar target/your-app.jar
|
||||||
|
|
Loading…
Reference in a new issue