Skip to content

added pr-test #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Tests for all platforms

on:
pull_request:
branches:
- main
- master
- develop

jobs:
build-native:
name: Build Native Library (${{ matrix.os }} - ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
include:
- os: ubuntu-24.04
arch: x64
OUT_OS_NAME: linux
- os: ubuntu-24.04-arm
arch: arm64
OUT_OS_NAME: linux
- os: macos-13
arch: x64
OUT_OS_NAME: darwin
- os: macos-15
arch: arm64
OUT_OS_NAME: darwin
- os: windows-2025
arch: x64
OUT_OS_NAME: windows
# - os: windows-11-arm
# arch: arm64
# OUT_OS_NAME: windows
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4

# Existing build steps remain unchanged
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: '1.11'

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

# Install cross toolchain for aarch64 on Ubuntu
- name: Install cross toolchain (aarch64)
if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'aarch64' }}
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

- name: Install dependencies
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y cmake swig gcc g++
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew update
brew install cmake swig
elif [[ "$RUNNER_OS" == "Windows" ]]; then
choco install cmake swig
fi

- name: Build native library
shell: bash
run: |
cd swig
cmake .
cmake --build . --config Release
cmake --install . --config Release
cd ..
echo "Library built at: $(pwd)/src/main/resources/native/${{ matrix.OUT_OS_NAME }}/${{ matrix.arch }}"

- name: Local test of native library
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
./gradlew.bat test
else
./gradlew test
fi
echo "Native library tests passed."
Loading