| # 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: Sonar-Coveralls |
| |
| on: |
| push: |
| branches: |
| - master |
| - "rel/*" |
| - "new_*" |
| paths-ignore: |
| - "docs/**" |
| pull_request: |
| branches: |
| - master |
| - "rel/*" |
| - "new_*" |
| paths-ignore: |
| - "docs/**" |
| # allow manually run the action: |
| workflow_dispatch: |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: true |
| |
| env: |
| MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 |
| PR_NUMBER: ${{ github.event.number }} |
| |
| jobs: |
| ubuntu: |
| runs-on: ubuntu-latest |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'apache/iotdb' || github.event_name == 'push' |
| |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up JDK 11 |
| uses: actions/setup-java@v1 |
| with: |
| java-version: 11 |
| - name: Cache Maven packages |
| uses: actions/cache@v2 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2- |
| - name: IT/UT Test |
| # we do not compile client-cpp for saving time, it is tested in client.yml |
| run: mvn -B clean compile post-integration-test -Dcluster.test.skip=true -Dtest.port.closed=true -Pcode-coverage -P '!testcontainer,!influxdb-protocol' |
| - name: Code Coverage (Coveralls) |
| if: ${{ success() }} |
| run: | |
| mvn -B post-integration-test -Pcode-coverage -pl code-coverage |
| mvn -B coveralls:report \ |
| -DserviceName=travis_ci \ |
| -Dbranch=$BRANCH_NAME \ |
| -DpullRequest=$PR_NUMBER \ |
| -DrepoToken=${{ secrets.COVERALL_TOKEN }} \ |
| -Pcode-coverage -P '!testcontainer' |
| - name: SonarCloud Report |
| if: ${{ success() }} |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} |
| run: | |
| mvn -B verify sonar:sonar \ |
| -Dsonar.organization=apache \ |
| -Dsonar.projectKey=apache_incubator-iotdb \ |
| -Dsonar.host.url=https://sonarcloud.io \ |
| -Dsonar.login=${{ secrets.SONARCLOUD_TOKEN }} \ |
| -DskipTests -pl '!distribution,!integration-test' -P '!testcontainer' -am |