From d51430c744580cb94d3a9a3af0a440c55c0b5022 Mon Sep 17 00:00:00 2001 From: Roman S Samarev Date: Sat, 7 Jun 2025 17:37:48 +0300 Subject: [PATCH 1/2] added pr-test --- .github/workflows/pr-test.yml | 101 ++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/pr-test.yml diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml new file mode 100644 index 0000000..948c614 --- /dev/null +++ b/.github/workflows/pr-test.yml @@ -0,0 +1,101 @@ +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." + + - name: Upload Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: (!cancelled()) + with: + files: | + test-results/**/*.xml + test-results/**/*.trx + test-results/**/*.json From 1ee783a8b75aaa8c4ca5189e44296b5225759c81 Mon Sep 17 00:00:00 2001 From: Roman S Samarev Date: Sat, 7 Jun 2025 17:42:05 +0300 Subject: [PATCH 2/2] added pr-test --- .github/workflows/pr-test.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 948c614..aec48cc 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -90,12 +90,3 @@ jobs: ./gradlew test fi echo "Native library tests passed." - - - name: Upload Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 - if: (!cancelled()) - with: - files: | - test-results/**/*.xml - test-results/**/*.trx - test-results/**/*.json