GHA: add graal.yml workflow #45
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: GraalVM Build | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
validate_gradle_wrapper: | |
name: "Validate Gradle Wrapper" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/actions/wrapper-validation@v4 | |
build_gradle: | |
needs: validate_gradle_wrapper | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-14] | |
java: [ '25-ea' ] | |
distribution: [ 'graalvm' ] | |
fail-fast: false | |
name: ${{ matrix.os }} ${{ matrix.java }} (via setup-graalvm) | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Set up GraalVM | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
distribution: ${{ matrix.distribution }} | |
java-version: ${{ matrix.java }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install secp256k1 with APT | |
if: runner.os == 'Linux' | |
run: sudo apt-get -y install libsecp256k1-2 libsecp256k1-dev | |
- name: Install secp256k1 with Homebrew | |
if: runner.os == 'macOS' | |
run: | | |
brew install secp256k1 | |
echo "DYLD_LIBRARY_PATH=$(brew --prefix secp256k1)/lib" >> $GITHUB_ENV | |
echo "JAVA_TOOL_OPTIONS=-Djava.library.path=$(brew --prefix secp256k1)/lib" >> $GITHUB_ENV | |
- name: Build (JIT) with Gradle | |
run: ./gradlew build | |
- name: Run Java & Kotlin Examples | |
run: ./gradlew build run runEcdsa | |
- name: Build Native Image with Gradle | |
run: ./gradlew build secp-examples-java:nativeCompile | |
- name: Run Schnorr Native Example | |
run: ./secp-examples-java/build/schnorr-example | |
build_nix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-14] | |
fail-fast: false | |
name: ${{ matrix.os }} Nix | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v31 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install secp256k1 with Nix | |
run: nix profile install nixpkgs#secp256k1 | |
- name: Build in Nix development shell | |
run: nix develop -c gradle build secp-examples-java:nativeCompile | |
- name: Run Schnorr Native Example | |
run: | | |
export LD_LIBRARY_PATH="$HOME/.nix-profile/lib" | |
export DYLD_LIBRARY_PATH="$HOME/.nix-profile/lib" | |
./secp-examples-java/build/schnorr-example |