Parsing of file sizes and testing. #1747
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: build | |
| on: | |
| push: | |
| branches: [main, "REL-*"] | |
| workflow_dispatch: | |
| inputs: | |
| skipTests: | |
| description: 'Skip tests' | |
| required: true | |
| default: false | |
| type: boolean | |
| os: | |
| description: 'OS' | |
| required: false | |
| default: 'all' | |
| type: choice | |
| options: | |
| - 'all' | |
| - ubuntu-latest | |
| - windows-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| skipTests: false | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # os: [ ubuntu-latest, windows-latest] | |
| include: | |
| - os: ubuntu-latest | |
| java: 17 | |
| target: 'deploy' | |
| - os: ubuntu-latest | |
| java: 21 | |
| target: 'test' | |
| - os: windows-latest | |
| java: 21 | |
| target: 'test' | |
| - os: ubuntu-latest | |
| java: 25 # LTS | |
| target: 'test' | |
| - os: ubuntu-latest | |
| java: 26 # latest release | |
| target: 'test' | |
| name: '${{ matrix.target }} on java ${{ matrix.java }}, ${{ matrix.os }}' | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| MAVEN_ARGS: '--no-transfer-progress --color always' | |
| steps: | |
| - id: os_check | |
| name: Check OS input | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" != "workflow_dispatch" || "${{ inputs.os }}" == "all" || "${{ inputs.os }}" == "${{ matrix.os }}" ]] ; then | |
| echo "not_skipped=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "not_skipped=false" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: actions/checkout@v6 | |
| if: steps.os_check.outputs.not_skipped | |
| - name: Set up JDK | |
| if: steps.os_check.outputs.not_skipped | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| server-id: central | |
| server-username: CENTRAL_USERNAME | |
| server-password: CENTRAL_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | |
| cache: maven | |
| - name: Run tests (pull request) | |
| if: steps.os_check.outputs.not_skipped && github.event_name == 'pull_request' | |
| run: mvn -B test | |
| # For push to main or manual dispatch, run the deploy profile. | |
| - name: Build and ${{ matrix.target }} with Maven | |
| if: steps.os_check.outputs.not_skipped && github.event_name != 'pull_request' | |
| shell: bash | |
| run: "mvn -fae -DskipITs=false -DskipTests=${skipTests} -D'maven.test.failure.ignore=true' -B -P'deploy' ${{ matrix.target }} -Dgpg.skip=false" | |
| env: | |
| CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | |
| CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }} | |
| continue-on-error: ${{ matrix.target != 'deploy' }} | |
| - name: Publish to codecov | |
| if: steps.os_check.outputs.not_skipped && matrix.target == 'deploy' && github.event_name != 'pull_request' | |
| uses: codecov/codecov-action@v6 | |
| continue-on-error: true | |
| - name: Publish Unit Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: steps.os_check.outputs.not_skipped && runner.os == 'Linux' | |
| with: | |
| check_name: Tests results java ${{ matrix.java }}, os ${{ matrix.os }} | |
| files: "**/target/surefire-reports/*.xml" | |
| - name: Publish Unit Test Results | |
| uses: EnricoMi/publish-unit-test-result-action/windows/bash@v2 | |
| if: steps.os_check.outputs.not_skipped && runner.os == 'Windows' | |
| with: | |
| check_name: Tests results java ${{ matrix.java }}, os ${{ matrix.os }} | |
| files: "**/target/surefire-reports/*.xml" | |
| - uses: MMProgrami/after-maven-action@v2 | |
| name: Simple results | |
| if: steps.os_check.outputs.not_skipped |