Skip to content

Commit

Permalink
Fix Windows CI
Browse files Browse the repository at this point in the history
Signed-off-by: Naveen Tatikonda <[email protected]>
  • Loading branch information
naveentatikonda committed Oct 24, 2023
1 parent a58de15 commit e99e785
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 40 deletions.
83 changes: 44 additions & 39 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,49 @@ on:
- "feature/**"

jobs:
Build-k-NN:
strategy:
matrix:
java: [11, 17]
os: [ubuntu-latest, macos-latest]

name: Build and Test k-NN Plugin
runs-on: ${{ matrix.os }}

steps:
- name: Checkout k-NN
uses: actions/checkout@v1

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Install dependencies on ubuntu
if: startsWith(matrix.os,'ubuntu')
run: |
sudo apt-get install libopenblas-dev gfortran -y
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
run: |
brew reinstall gcc
export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran
- name: Run build
run: |
./gradlew build
- name: Upload Coverage Report
if: startsWith(matrix.os,'ubuntu')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Build-k-NN:
# strategy:
# matrix:
# java: [11, 17]
# os: [ubuntu-latest, macos-latest]
#
# name: Build and Test k-NN Plugin
# runs-on: ${{ matrix.os }}
#
# steps:
# - name: Checkout k-NN
# uses: actions/checkout@v1
#
# - name: Setup Java ${{ matrix.java }}
# uses: actions/setup-java@v1
# with:
# java-version: ${{ matrix.java }}
#
# - name: Install dependencies on ubuntu
# if: startsWith(matrix.os,'ubuntu')
# run: |
# sudo apt-get install libopenblas-dev gfortran -y
#
# - name: Install dependencies on macos
# if: startsWith(matrix.os, 'macos')
# run: |
# brew reinstall gcc
# export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran
#
# - name: Run build
# run: |
# ./gradlew build
#
# - name: Upload Coverage Report
# if: startsWith(matrix.os,'ubuntu')
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

Build-k-NN-Windows:
strategy:
matrix:
java: [ 11, 17 ]
java: [ 11 ]

name: Build and Test k-NN Plugin on Windows
runs-on: windows-latest
Expand All @@ -77,7 +77,12 @@ jobs:
- name: Add MinGW to PATH
run: |
echo "C:/Users/runneradmin/scoop/apps/mingw/current/bin" >> $env:GITHUB_PATH
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
# iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# choco install -y git
# $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."


- name: Download OpenBLAS
run: |
Expand Down
4 changes: 3 additions & 1 deletion jni/src/jni_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <stdexcept>
#include <string>
#include <vector>
#include <cstdint>


void knn_jni::JNIUtil::Initialize(JNIEnv *env) {
Expand Down Expand Up @@ -276,7 +277,8 @@ std::vector<int64_t> knn_jni::JNIUtil::ConvertJavaIntArrayToCppIntVector(JNIEnv
for(int i = 0; i < numElements; ++i) {
vectorCpp.push_back(arrayCpp[i]);
}
env->ReleaseIntArrayElements(arrayJ, arrayCpp, JNI_ABORT);
// env->ReleaseIntArrayElements(arrayJ, (jint*)arrayCpp, JNI_ABORT);
env->ReleaseIntArrayElements(arrayJ, arrayCpp, JNI_ABORT);
return vectorCpp;
}

Expand Down

0 comments on commit e99e785

Please sign in to comment.