| # This workflow will build a Java project with Maven |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| |
| name: Build and run tests |
| |
| on: |
| push: |
| branches: [ master, unomi-1.6.x ] |
| pull_request: |
| branches: [ master ] |
| |
| jobs: |
| unit-tests: |
| name: Execute unit tests |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| java: [ 1.8, 11] |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up JDK ${{ matrix.java }} |
| uses: actions/setup-java@v1 |
| with: |
| java-version: ${{ matrix.java }} |
| cache: maven |
| - name: Build and Unit tests |
| run: mvn -U -ntp -e clean install |
| |
| integration-tests: |
| name: Execute integration tests |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| java: [ 1.8, 11] |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up JDK ${{ matrix.java }} |
| uses: actions/setup-java@v1 |
| with: |
| java-version: ${{ matrix.java }} |
| cache: maven |
| - name: Integration tests |
| run: mvn -ntp clean install -Pintegration-tests |
| - name: Archive code coverage logs |
| uses: actions/upload-artifact@v3 |
| with: |
| name: unomi-code-coverage-jdk${{ matrix.java }}-${{ github.run_number }} |
| path: itests/target/site/jacoco |
| - name: Archive unomi logs |
| uses: actions/upload-artifact@v3 |
| if: failure() |
| with: |
| name: unomi-log-jdk${{ matrix.java }}-${{ github.run_number }} |
| path: itests/target/exam/**/data/log |
| - name: Publish Test Report |
| uses: mikepenz/action-junit-report@v3 |
| if: failure() |
| with: |
| report_paths: 'itests/target/failsafe-reports/TEST-*.xml' |