diff --git a/.github/workflows/jacoco b/.github/workflows/jacoco new file mode 100644 index 0000000..c5697b8 --- /dev/null +++ b/.github/workflows/jacoco @@ -0,0 +1,33 @@ +name: Jacoco Coverage + +on: + pull_request: + branches: [ feature/version/upgrade ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '17' + + - name: Build with Maven + run: mvn clean verify + + - name: Upload Jacoco Report + uses: actions/upload-artifact@v2 + with: + name: jacoco-report + path: target/site/jacoco + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2.1.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./target/site/jacoco/index.html diff --git a/.github/workflows/jacoco-1.yml b/.github/workflows/jacoco-1.yml new file mode 100644 index 0000000..0263954 --- /dev/null +++ b/.github/workflows/jacoco-1.yml @@ -0,0 +1,39 @@ +name: jacoco-1 + +on: + push: + branches: [ "feature/Junit"] + paths-ignore: + - 'target/**' + pull_request: + branches: [ "feature/Junit" ] + paths-ignore: + - 'target/**' + +env: + ENV_VAR: test + +jobs: + Package-test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean install -DENV_VAR=test + + - name: Build WAR file + run: mvn -B package --file pom.xml + + - name: Upload JaCoCo coverage report + uses: actions/upload-artifact@v2 + with: + name: jacoco-report + path: target/site/jacoco/