|
| 1 | +# Copyright © 2022 Cask Data, Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 3 | +# use this file except in compliance with the License. You may obtain a copy of |
| 4 | +# the License at |
| 5 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +# Unless required by applicable law or agreed to in writing, software |
| 7 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 8 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 9 | +# License for the specific language governing permissions and limitations under |
| 10 | +# the License. |
| 11 | + |
| 12 | +# This workflow will build a Java project with Maven |
| 13 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 14 | +# Note: Any changes to this workflow would be used only after merging into develop |
| 15 | +name: Build with unit tests |
| 16 | + |
| 17 | +on: |
| 18 | + workflow_run: |
| 19 | + workflows: |
| 20 | + - Trigger build |
| 21 | + types: |
| 22 | + - completed |
| 23 | + |
| 24 | +jobs: |
| 25 | + build: |
| 26 | + runs-on: k8s-runner-build |
| 27 | + |
| 28 | + if: ${{ github.event.workflow_run.conclusion != 'skipped' }} |
| 29 | + |
| 30 | + steps: |
| 31 | + # Pinned 1.0.0 version |
| 32 | + - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 |
| 33 | + |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + with: |
| 36 | + ref: ${{ github.event.workflow_run.head_sha }} |
| 37 | + |
| 38 | + - name: Cache |
| 39 | + uses: actions/cache@v3 |
| 40 | + with: |
| 41 | + path: ~/.m2/repository |
| 42 | + key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }} |
| 43 | + restore-keys: | |
| 44 | + ${{ runner.os }}-maven-${{ github.workflow }} |
| 45 | +
|
| 46 | + - name: Build with Maven |
| 47 | + run: mvn clean compile test -fae -T 2 -B -V -DcloudBuild -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 |
| 48 | + |
| 49 | + - name: Archive build artifacts |
| 50 | + uses: actions/upload-artifact@v3 |
| 51 | + if: always() |
| 52 | + with: |
| 53 | + name: Build debug files |
| 54 | + path: | |
| 55 | + **/target/rat.txt |
| 56 | + **/target/surefire-reports/* |
| 57 | +
|
| 58 | + - name: Surefire Report |
| 59 | + # Pinned 3.5.2 version |
| 60 | + uses: mikepenz/action-junit-report@16a9560bd02f11e7e3bf6b3e2ef6bba6c9d07c32 |
| 61 | + if: always() |
| 62 | + with: |
| 63 | + report_paths: '**/target/surefire-reports/TEST-*.xml' |
| 64 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + detailed_summary: true |
| 66 | + commit: ${{ github.event.workflow_run.head_sha }} |
| 67 | + check_name: Test Report |
0 commit comments