API-2456 Sonarqube Java SDK #310
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: [ push, pull_request_target ] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 8 | |
| - name: Maven Package | |
| run: mvn clean install -Dgpg.skip -Dmaven.javadoc.skip -Dmaven.test.skip | |
| - name: Tests with Coverage | |
| run: mvn clean test jacoco:report | |
| - name: Set branch name and PR number | |
| id: refs | |
| env: | |
| BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} | |
| run: | | |
| echo "::set-output name=branch_name::${BRANCH_NAME_OR_REF#refs/heads/}" | |
| echo "::set-output name=pr_number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" | |
| - name: Report to Coveralls | |
| env: | |
| CI_NAME: Github | |
| CI_BUILD_NUMBER: ${{ github.run_id }} | |
| CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks | |
| CI_BRANCH: ${{ steps.refs.outputs.branch_name }} | |
| CI_PULL_REQUEST: ${{ steps.refs.outputs.pr_number }} | |
| run: | | |
| mvn coveralls:report \ | |
| --no-transfer-progress \ | |
| -D repoToken=${{ secrets.COVERALLS_TOKEN }} |