Skip to content

fix(ZBytes): publish the lazy byte cache safely #3193

fix(ZBytes): publish the lazy byte cache safely

fix(ZBytes): publish the lazy byte cache safely #3193

Workflow file for this run

name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
schedule:
- cron: "0 6 * * 1-5"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ["${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Check out zenoh-java
uses: actions/checkout@v4
with:
path: zenoh-java
- name: Check out zenoh-flat-jni
uses: actions/checkout@v4
with:
repository: eclipse-zenoh/zenoh-flat-jni
ref: 6f81eb8f9d5c49b72dda2fb054a174cce3184f2a
path: zenoh-flat-jni
- name: Check out zenoh-flat
uses: actions/checkout@v4
with:
repository: eclipse-zenoh/zenoh-flat
ref: 81feb940cce9f4c3b33a87de397b2ce42cb5fc9e
path: zenoh-flat
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Install Rust toolchain
run: |
rustup show
rustup component add rustfmt clippy --toolchain 1.93.0
- name: Cargo Format
working-directory: zenoh-flat-jni
run: cargo fmt --check
- name: Clippy Check
working-directory: zenoh-flat-jni
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check for feature leaks
working-directory: zenoh-flat-jni
run: cargo test --no-default-features
- name: Build zenoh-flat-jni
working-directory: zenoh-flat-jni
run: cargo build
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Gradle Test
working-directory: zenoh-java
# CI builds against the sibling checkouts above, so it opts into the
# composite build explicitly. A release does not: it resolves
# zenoh-flat-jni from Maven Central like any other consumer.
run: ./gradlew jvmTest --info -PuseLocalFlatJni=true
markdown_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: '.markdownlint.yaml'
globs: '**/README.md'
# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
# from branches where specific status checks have passed. These checks are
# specified manually as a list of workflow job names. Thus we use this extra
# job to signal whether all CI checks have passed.
ci:
name: CI status checks
runs-on: ubuntu-latest
needs: [build, markdown_lint]
if: always()
steps:
- name: Check whether all jobs pass
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'
# Publish snapshot packages. Only triggered when CI runs on main.
# One job, because both publications now come from a single Gradle
# invocation — see .github/workflows/publish.yml.
publish_snapshot_package:
name: Publish snapshot package
if: contains(fromJSON('["refs/heads/main"]'), github.ref)
needs: ci
uses: ./.github/workflows/publish.yml
permissions:
contents: read
packages: write
with:
snapshot: true
branch: ${{ github.ref_name }}
secrets: inherit