Update protobuf-java to 4.36.1 #1803
Workflow file for this run
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: Scala build and test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| env: | |
| # RDF4J 6 class files are Java 25 bytecode, so the build requires JDK 25+. The artifacts | |
| # themselves still target Java 21 (see javacOptions in build.sbt). | |
| java_publish: 25 | |
| JELLY_TEST_SILENCE_OUTPUT: 'true' | |
| jobs: | |
| # Run scalatest | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # RDF4J 6 ships Java 25 bytecode, so JDK 25 (LTS) is the build baseline; we also test on | |
| # the latest release (26). Across those we exercise the oldest and newest supported Jena | |
| # versions. The dependencies default to Jena 5.6 and RDF4J 6.0. | |
| - os: ubuntu-latest | |
| java: 25 | |
| # Jena 5.4.0 is the oldest supported version - it introduced the RDF 1.2 triple term | |
| # API that we use, replacing the RDF-star API of 5.3.x and older. | |
| jena_version: "5.4.0" | |
| rdf4j_version: "" | |
| - os: ubuntu-latest | |
| java: 25 | |
| jena_version: "6.2.0" | |
| rdf4j_version: "" | |
| - os: ubuntu-latest | |
| java: 26 | |
| jena_version: "" | |
| rdf4j_version: "" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Setup JDK | |
| uses: actions/setup-java@v6.0.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Setup SBT | |
| uses: sbt/setup-sbt@v1 | |
| # Jena and RDF4J occasionally change their APIs between minor versions, so we test against | |
| # the oldest and the newest supported version of each. | |
| - name: Switch Jena and RDF4J versions | |
| shell: bash | |
| run: | | |
| set -e | |
| if [ $JENA_VERSION ]; then | |
| sed -i "s/lazy val jenaV = .*/lazy val jenaV = \"$JENA_VERSION\"/g" build.sbt | |
| grep 'lazy val jenaV' build.sbt | |
| fi | |
| if [ $RDF4J_VERSION ]; then | |
| sed -i "s/lazy val rdf4jV = .*/lazy val rdf4jV = \"$RDF4J_VERSION\"/g" build.sbt | |
| grep 'lazy val rdf4jV' build.sbt | |
| fi | |
| env: | |
| JENA_VERSION: ${{ matrix.jena_version }} | |
| RDF4J_VERSION: ${{ matrix.rdf4j_version }} | |
| - name: Build and test | |
| shell: bash | |
| run: sbt -v +test | |
| env: | |
| JENA_VERSION: ${{ matrix.jena_version }} | |
| RDF4J_VERSION: ${{ matrix.rdf4j_version }} | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Setup JDK | |
| uses: actions/setup-java@v6.0.0 | |
| with: | |
| distribution: temurin | |
| java-version: 25 # coverage must run on an LTS version | |
| - name: Setup SBT | |
| uses: sbt/setup-sbt@v1 | |
| - name: Build and test with coverage | |
| shell: bash | |
| run: sbt -v "coverage; +test; coverageReport; coverageAggregate; jacocoAggregate" | |
| env: | |
| JENA_VERSION: "" | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| fail_ci_if_error: true # This is an independent check, so it's okay to fail | |
| slug: Jelly-RDF/jelly-jvm | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # Test publishing to a local repository | |
| test-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Setup JDK | |
| uses: actions/setup-java@v6.0.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ env.java_publish }} | |
| - name: Setup SBT | |
| uses: sbt/setup-sbt@v1 | |
| - name: Test publishing to a local repository | |
| run: sbt -v +publishLocal | |
| # Test building assemblies | |
| test-assembly: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Setup JDK | |
| uses: actions/setup-java@v6.0.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ env.java_publish }} | |
| - name: Setup SBT | |
| uses: sbt/setup-sbt@v1 | |
| - name: Test building assemblies | |
| shell: bash | |
| # sbt 2.x's sbtn client joins CLI args into one command line; separate commands with `;`. | |
| # neo4jPlugin is not built – it cannot work with RDF4J 6. See build.sbt. | |
| run: sbt -v "+jenaPlugin/assembly; +rdf4jPlugin/assembly" | |
| - name: Cache Jena | |
| id: cache-jena | |
| uses: actions/cache@v6 | |
| with: | |
| path: jena-dir | |
| key: jena | |
| - name: Download Jena | |
| if: steps.cache-jena.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| wget --progress=dot:mega -O jena.tar.gz https://archive.apache.org/dist/jena/binaries/apache-jena-5.6.0.tar.gz | |
| mkdir -p jena-dir | |
| tar -xzf jena.tar.gz -C jena-dir --strip-components=1 | |
| - name: Save Jena cache | |
| if: steps.cache-jena.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v6 | |
| with: | |
| path: jena-dir | |
| key: jena | |
| - name: Cache RDF4J SDK | |
| id: cache-rdf4j | |
| uses: actions/cache@v6 | |
| with: | |
| path: rdf4j-dir | |
| key: rdf4j | |
| - name: Download RDF4J | |
| if: steps.cache-rdf4j.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| wget --progress=dot:mega -O rdf4j.zip https://mirrors.xmission.com/eclipse/rdf4j/eclipse-rdf4j-5.2.2-sdk.zip | |
| unzip -q rdf4j.zip | |
| mv eclipse-rdf4j-5.2.2 rdf4j-dir | |
| - name: Save RDF4J cache | |
| if: steps.cache-rdf4j.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v6 | |
| with: | |
| path: rdf4j-dir | |
| key: rdf4j | |
| - name: Cache Fuseki | |
| id: cache-fuseki | |
| uses: actions/cache@v6 | |
| with: | |
| path: fuseki-dir | |
| key: fuseki | |
| - name: Download Fuseki | |
| if: steps.cache-fuseki.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| wget --progress=dot:mega -O fuseki.tar.gz https://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-5.6.0.tar.gz | |
| mkdir -p fuseki-dir | |
| tar -xzf fuseki.tar.gz -C fuseki-dir --strip-components=1 | |
| - name: Save Fuseki cache | |
| if: steps.cache-fuseki.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v6 | |
| with: | |
| path: fuseki-dir | |
| key: fuseki | |
| - name: Test plugins | |
| shell: bash | |
| run: | | |
| echo '_:b <http://ex.org/p> <http://ex.org/o> .' > test.nt | |
| cp examples/src/main/resources/jelly/weather.jelly test.jelly | |
| # The Jena plugin JAR must contain Jelly's classes and nothing else. | |
| # A second copy of Jena or protobuf-java in the classpath would break the host app. | |
| if unzip -l jena-plugin/target/jelly-jena-plugin.jar \ | |
| | grep -qE "org/apache/jena/|com/google/protobuf/"; then | |
| echo "Jena plugin JAR bundles classes that Jena already provides" | |
| exit 1 | |
| fi | |
| # Both the RDF and the SPARQL parts of the plugin have to register themselves. The two | |
| # service files come from separate modules, so a packaging mistake would drop one of them. | |
| for lifecycle in riot.JellySubsystemLifecycle fuseki.JellyFusekiLifecycle \ | |
| sparql.JellySparqlSubsystemLifecycle sparql.JellySparqlFusekiLifecycle; do | |
| unzip -p jena-plugin/target/jelly-jena-plugin.jar \ | |
| META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle \ | |
| | grep -q "$lifecycle" \ | |
| || { echo "Jena plugin JAR does not register $lifecycle"; exit 1; } | |
| done | |
| echo Jena plugin JAR contents OK | |
| cp -f jena-plugin/target/jelly-jena-plugin.jar jena-dir/lib | |
| ./jena-dir/bin/riot --stream=nt test.jelly > jena.nt | |
| [ -s jena.nt ] && echo Jena reading Jelly OK | |
| ./jena-dir/bin/riot --stream=jelly test.nt > jena.jelly | |
| [ -s jena.jelly ] && echo Jena writing Jelly OK | |
| cp -f rdf4j-plugin/target/jelly-rdf4j-plugin.jar rdf4j-dir/lib | |
| echo "convert test.jelly rdf4j.nt" | ./rdf4j-dir/bin/console.sh | |
| [ -s rdf4j.nt ] && echo RDF4J reading Jelly OK | |
| # # Broken because of an upstream issue | |
| # echo "convert test.nt rdf4j.jelly" | ./rdf4j-dir/bin/console.sh | |
| # [ -s rdf4j.jelly ] && echo RDF4J writing Jelly OK | |
| - name: Test Jelly-SPARQL in Fuseki | |
| shell: bash | |
| run: | | |
| # Fuseki picks up plugins from $FUSEKI_BASE/extra, which is run/extra by default. | |
| mkdir -p fuseki-dir/run/extra | |
| cp -f jena-plugin/target/jelly-jena-plugin.jar fuseki-dir/run/extra/ | |
| echo '<http://ex.org/s> <http://ex.org/p> "hello" .' > fuseki-test.nt | |
| root=$(pwd) | |
| cd fuseki-dir | |
| ./fuseki-server --port=3391 --file="$root/fuseki-test.nt" /ds > "$root/fuseki.log" 2>&1 & | |
| fuseki_pid=$! | |
| cd "$root" | |
| for _ in $(seq 1 60); do | |
| curl -fsS "http://localhost:3391/\$/ping" > /dev/null 2>&1 && break | |
| sleep 1 | |
| done | |
| query() { | |
| curl -s -H "Accept: $1" --get --data-urlencode "query=$2" \ | |
| "http://localhost:3391/ds" -o "$3" -w '%{content_type}' | cut -d';' -f1 | |
| } | |
| status=0 | |
| if ! grep -q "Added application/x-jelly-sparql" fuseki.log; then | |
| echo "Fuseki did not register the Jelly-SPARQL content type" | |
| cat fuseki.log | |
| status=1 | |
| fi | |
| select_ct=$(query application/x-jelly-sparql 'SELECT * WHERE { ?s ?p ?o }' select.jellys) | |
| if [ "$select_ct" = "application/x-jelly-sparql" ] && [ -s select.jellys ]; then | |
| echo "Fuseki answering SELECT with Jelly-SPARQL OK" | |
| else | |
| echo "Fuseki answered SELECT with $select_ct instead of Jelly-SPARQL" | |
| status=1 | |
| fi | |
| ask_ct=$(query application/x-jelly-sparql 'ASK { ?s ?p ?o }' ask.jellys) | |
| if [ "$ask_ct" = "application/x-jelly-sparql" ] && [ -s ask.jellys ]; then | |
| echo "Fuseki answering ASK with Jelly-SPARQL OK" | |
| else | |
| echo "Fuseki answered ASK with $ask_ct instead of Jelly-SPARQL" | |
| status=1 | |
| fi | |
| kill $fuseki_pid | |
| exit $status |