Add Java and Kotlin protobuf bindings #4
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: JVM bindings | |
| # The Java and Kotlin bindings are built with Maven directly rather than | |
| # Nix because scip-kotlin depends on scip-java as a Maven artifact, which | |
| # nixpkgs' offline `maven.buildMavenPackage` sandbox cannot resolve from | |
| # the sibling derivation. A regular `mvn install` -> `mvn package` flow | |
| # in a single CI job is simpler and more reliable. | |
| on: | |
| pull_request: | |
| paths: | |
| - bindings/java/** | |
| - bindings/kotlin/** | |
| - cmd/scip/version.txt | |
| - scip.proto | |
| - .github/workflows/jvm-bindings.yaml | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: jvm-bindings-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 11 | |
| cache: maven | |
| - name: Validate pom.xml versions match cmd/scip/version.txt | |
| shell: python | |
| run: | | |
| import xml.etree.ElementTree as ET | |
| expected = open('cmd/scip/version.txt').read().strip() | |
| for pom in 'bindings/java/pom.xml', 'bindings/kotlin/pom.xml': | |
| actual = ET.parse(pom).getroot().findtext('{http://maven.apache.org/POM/4.0.0}version') | |
| assert actual == expected, f'{pom}: version is {actual!r}, expected {expected!r}' | |
| - name: Build scip-java and install to local Maven repo | |
| run: mvn -B -ntp -f bindings/java/pom.xml install | |
| - name: Build scip-kotlin (resolves scip-java from local repo) | |
| run: mvn -B -ntp -f bindings/kotlin/pom.xml package |