ci: add release workflow (#9) #53
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 and Test | |
| on: | |
| push: | |
| branches: main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build with Gradle | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # all the LTS versions | |
| java: [ '8', '11', '17', '21' ] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Check code formatting | |
| # older versions are incompatible with our spotless version | |
| if: matrix.java == '17' || matrix.java == '21' | |
| run: ./gradlew spotlessCheck --no-daemon | |
| - name: Build and test with JDK ${{ matrix.java }} | |
| run: ./gradlew build --no-daemon -PjavaToolchain=${{ matrix.java }} | |
| env: | |
| GRADLE_OPTS: -Dorg.gradle.java.installations.auto-download=true |