Skip to content

Uat 2

Uat 2 #940

Workflow file for this run

name: Java CI
on:
push:
branches:
- main
pull_request:
branches: '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- run: rm -rf /tmp/*
continue-on-error: true
- name: Build with Maven
env:
AWS_REGION: us-west-2
run: mvn -ntp -U clean verify
- name: Upload Failed Test Report
uses: actions/[email protected]
if: failure()
with:
name: Failed Test Report
path: target/surefire-reports
- name: Upload Coverage
uses: actions/[email protected]
if: always()
with:
name: Coverage Report
path: target/jacoco-report
- name: Upload unit test coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: target/jacoco-report
files: jacoco.xml
flags: unit
- name: Upload integration test coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: target/jacoco-report/jacoco-it
files: jacoco.xml
flags: integration
- name: Convert Jacoco unit test report to Cobertura
run: python3 .github/scripts/cover2cover.py target/jacoco-report/jacoco.xml src/main/java > target/jacoco-report/cobertura.xml
- name: Convert Jacoco integ test report to Cobertura
run: python3 .github/scripts/cover2cover.py target/jacoco-report/jacoco-it/jacoco.xml src/main/java > target/jacoco-report/cobertura-it.xml
- name: Save PR number
run: |
mkdir -p ./pr/jacoco-report
echo ${{ github.event.number }} > ./pr/NR
echo ${{ github.event.pull_request.head.sha }} > ./pr/SHA
cp target/jacoco-report/cobertura.xml ./pr/jacoco-report/cobertura.xml
cp target/jacoco-report/cobertura-it.xml ./pr/jacoco-report/cobertura-it.xml
if: github.event_name == 'pull_request'
- name: Upload files
uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
if: github.event_name == 'pull_request'