ci.yml changes

This commit is contained in:
Joonhang35 2024-09-06 13:21:11 +08:00
parent d0fc93cd40
commit 9a5d7f7977

View file

@ -2,9 +2,9 @@ name: CI Pipeline
on: on:
push: push:
branches: [ main ] branches: [main]
pull_request: pull_request:
branches: [ main ] branches: [main]
jobs: jobs:
build: build:
@ -20,29 +20,30 @@ jobs:
distribution: 'adopt' distribution: 'adopt'
java-version: '17' java-version: '17'
- name: Install Dependencies
run: mvn dependency:resolve
- name: Build with Maven - name: Build with Maven
run: mvn clean install run: mvn clean install
- name: Run Unit Tests - name: Run Unit Tests and Generate Coverage
run: mvn test run: mvn test jacoco:report
- name: Upload Build Artifacts - name: Upload Build Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: build-artifacts name: build-artifacts
path: target/** path: target/**
- name: Upload Test Reports - name: Upload Test Reports
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: test-reports name: test-reports
path: target/surefire-reports/** path: target/surefire-reports/**
- name: Generate Code Coverage Report
run: mvn jacoco:report
- name: Upload Code Coverage Report - name: Upload Code Coverage Report
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: code-coverage-report name: code-coverage-report
path: target/site/jacoco/** path: target/site/jacoco/**