ci: add GitHub Actions test workflow #1
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
| # CI workflow for java-sdk (Gradle, JDK 25). | |
| # | |
| # Action pinning policy: | |
| # - First-party actions (actions/*) are pinned to a major tag. | |
| # - Third-party actions are pinned to a full commit SHA with a version | |
| # comment alongside. | |
| name: test | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| - '.editorconfig' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| - '.editorconfig' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: test (JDK ${{ matrix.java }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # build.gradle.kts pins toolchain + options.release to JDK 25. | |
| # JDK 25 is the September 2025 LTS, so floor and latest LTS coincide. | |
| java: ['25'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| cache: gradle | |
| - name: Validate Gradle wrapper | |
| # gradle/actions/wrapper-validation v4.4.4 | |
| uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 | |
| - name: Resolve dependencies | |
| run: ./gradlew --no-daemon dependencies | |
| - name: Build | |
| run: ./gradlew --no-daemon assemble | |
| - name: Test | |
| run: ./gradlew --no-daemon test | |
| - name: Upload test reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-jdk${{ matrix.java }} | |
| path: | | |
| **/build/reports/tests/ | |
| **/build/test-results/ | |
| if-no-files-found: ignore | |
| retention-days: 7 |