|
| 1 | +# This workflow will build a Java project with Maven |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 3 | + |
| 4 | +name: Tests |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ master ] |
| 9 | + pull_request: |
| 10 | + branches: [ master ] |
| 11 | + |
| 12 | +jobs: |
| 13 | + tests-ce: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + timeout-minutes: 25 |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up JDK 1.8 |
| 22 | + uses: actions/setup-java@v3 |
| 23 | + with: |
| 24 | + distribution: 'zulu' |
| 25 | + java-version: '8' |
| 26 | + cache: 'maven' |
| 27 | + |
| 28 | + - name: Build and run unit tests |
| 29 | + run: ./mvnw -B verify -Djacoco.destFile=target/jacoco-ce.exec --file pom.xml |
| 30 | + |
| 31 | + - name: Run integration tests |
| 32 | + env: |
| 33 | + TARANTOOL_SERVER_USER: root |
| 34 | + TARANTOOL_SERVER_GROUP: root |
| 35 | + run: ./mvnw -B test -P integration -Djacoco.destFile=target/jacoco-ce.exec --file pom.xml |
| 36 | + |
| 37 | + - name: Upload jacoco exec results |
| 38 | + uses: actions/upload-artifact@v2 |
| 39 | + with: |
| 40 | + name: tests-ce-jacoco |
| 41 | + path: "**/jacoco-ce.exec" |
| 42 | + |
| 43 | + tests-ee: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + timeout-minutes: 20 |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + |
| 49 | + - name: Set up JDK 1.8 |
| 50 | + uses: actions/setup-java@v3 |
| 51 | + with: |
| 52 | + distribution: 'zulu' |
| 53 | + java-version: '8' |
| 54 | + cache: 'maven' |
| 55 | + |
| 56 | + - name: Run enterprise tests |
| 57 | + env: |
| 58 | + TARANTOOL_SERVER_USER: root |
| 59 | + TARANTOOL_SERVER_GROUP: root |
| 60 | + DOWNLOAD_HOST: https://tarantool:${{ secrets.DOWNLOAD_SDK_TOKEN }}@download.tarantool.io |
| 61 | + SDK_PATH: enterprise/release/linux/x86_64/2.11/tarantool-enterprise-sdk-nogc64-2.11.2-0-r609.linux.x86_64.tar.gz |
| 62 | + run: ./mvnw -B test -P enterprise -Djacoco.destFile=target/jacoco-ee.exec --file pom.xml |
| 63 | + |
| 64 | + - name: Upload jacoco exec results |
| 65 | + uses: actions/upload-artifact@v2 |
| 66 | + with: |
| 67 | + name: tests-ee-jacoco |
| 68 | + path: "**/jacoco-ee.exec" |
| 69 | + |
| 70 | + merge-jacoco-report: |
| 71 | + name: Jacoco Merge Results |
| 72 | + needs: |
| 73 | + - tests-ce |
| 74 | + - tests-ee |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + |
| 79 | + - name: Set up JDK 1.8 |
| 80 | + uses: actions/setup-java@v3 |
| 81 | + with: |
| 82 | + distribution: 'zulu' |
| 83 | + java-version: '8' |
| 84 | + cache: 'maven' |
| 85 | + |
| 86 | + - uses: actions/download-artifact@v2 |
| 87 | + with: |
| 88 | + name: tests-ce-jacoco |
| 89 | + path: . |
| 90 | + |
| 91 | + - uses: actions/download-artifact@v2 |
| 92 | + with: |
| 93 | + name: tests-ee-jacoco |
| 94 | + path: . |
| 95 | + |
| 96 | + - name: merge results |
| 97 | + run: | |
| 98 | + ./mvnw package jacoco:merge jacoco:report -DskipTests -Darguments=-DskipTests |
| 99 | +
|
| 100 | + - name: Upload jacoco coverage despite the check result |
| 101 | + if: ${{ always() }} |
| 102 | + uses: actions/upload-artifact@v2 |
| 103 | + with: |
| 104 | + name: coverage-results-report |
| 105 | + path: target/site/jacoco |
| 106 | + if-no-files-found: error |
| 107 | + |
| 108 | + - name: Jacoco Report to PR |
| 109 | + id: jacoco |
| 110 | + |
| 111 | + with: |
| 112 | + paths: target/site/jacoco/jacoco.xml |
| 113 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + min-coverage-overall: 40 |
| 115 | + min-coverage-changed-files: 60 |
| 116 | + update-comment: true |
0 commit comments