bindings/java #1052
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: bindings/java | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| schedule: | |
| # Run at 8:00 AM every day | |
| - cron: "0 8 * * *" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
| with: | |
| java-version: 8 | |
| distribution: "corretto" | |
| - uses: ./.github/actions/toolchains/rust | |
| - name: Building binding | |
| run: | | |
| cargo clippy --all-targets --no-deps -- -Dwarnings | |
| cargo build --release --manifest-path bindings/java/Cargo.toml --locked | |
| - name: Capture binding version | |
| run: | | |
| version=$(cargo metadata --manifest-path bindings/java/Cargo.toml --format-version 1 \ | |
| | jq -r '.packages[] | select(.name == "regorus-java") | .version') | |
| echo "REGORUS_JAVA_VERSION=$version" >> "$GITHUB_ENV" | |
| - name: Build jar | |
| run: mvn package | |
| working-directory: ./bindings/java | |
| - name: Test jar | |
| run: | | |
| jar="regorus-java-${REGORUS_JAVA_VERSION}.jar" | |
| javac -cp "target/${jar}" Test.java | |
| java -Djava.library.path=target/release -cp "target/${jar}:." Test | |
| working-directory: ./bindings/java |