From 521c3f8ff6b3db7def4d64bdce3a39b5ae059f39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 May 2020 08:10:02 -0500 Subject: Add github actions --- .github/workflows/main.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++ MANIFEST | 2 ++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a4e4e44 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,80 @@ +name: hdf5 dev CI + +# Controls when the action will run. Triggers the workflow on push or pull request +on: + push: + branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] + pull_request: + branches: [ develop ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + strategy: + fail-fast: false + matrix: + name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "macOS Latest Clang"] + include: + - name: "Windows Latest MSVC" + artifact: "Windows-MSVC.tar.xz" + os: windows-latest + build_type: "Release" + toolchain: "" + fortran: OFF + generator: "-G \"Visual Studio 16 2019\" -A x64" + - name: "Ubuntu Latest GCC" + artifact: "Linux.tar.xz" + os: ubuntu-latest + build_type: "Release" + fortran: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "macOS Latest Clang" + artifact: "macOS.tar.xz" + os: macos-latest + build_type: "Release" + fortran: OFF + toolchain: "config/toolchain/clang.cmake" + generator: "-G Ninja" + + name: ${{ matrix.name }} + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Install Dependencies (Linux) + run: sudo apt-get install ninja-build + if: matrix.os == 'ubuntu-latest' + - name: Install Dependencies (Windows) + run: choco install ninja + if: matrix.os == 'windows-latest' + - name: Install Dependencies (macOS) + run: brew install ninja + if: matrix.os == 'macos-latest' + - name: Set environment for MSVC (Windows) + if: matrix.os == 'windows-latest' + run: | + # Set these env vars so cmake picks the correct compiler + echo "::set-env name=CXX::cl.exe" + echo "::set-env name=CC::cl.exe" + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v2 + + - name: Setup CMake + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE + shell: bash + + - name: Build + run: cmake --build . --config ${{ matrix.build_type }} + working-directory: ${{ runner.workspace }}/build + + - name: Test + run: ctest --build . -C ${{ matrix.build_type }} -V + working-directory: ${{ runner.workspace }}/build diff --git a/MANIFEST b/MANIFEST index 2430ee8..523f5b0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -33,6 +33,8 @@ ./autogen.sh ./configure.ac +./github/workflows/main.yml _DO_NOT_DISTRIBUTE_ + ./m4/aclocal_cxx.m4 ./m4/aclocal_fc.m4 ./m4/aclocal_fc.f90 -- cgit v0.12 From c1565d2b576e2bf98918704dcda7f3187b89b28e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 May 2020 09:38:59 -0500 Subject: Correct test --- java/test/TestH5E.java | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 6f4f473..ac641c3 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -81,6 +81,7 @@ public class TestH5E { long errnum = hdferr.getMajorErrorNumber(); int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; String msg = null; + try { msg = H5.H5Eget_msg(errnum, error_msg_type); } @@ -91,15 +92,15 @@ public class TestH5E { assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector and the error string might be different. - * Only check for the specific error message if the native - * connector is being used. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) - assertEquals("H5.H5Eget_msg: ", "File accessibility", msg); + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector and the error string might be different. + * Only check for the specific error message if the native + * connector is being used. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertTrue("H5.H5Eget_msg: ", msg.contains("File accessibility")); } catch (Throwable err) { err.printStackTrace(); @@ -116,6 +117,7 @@ public class TestH5E { long errnum = hdferr.getMinorErrorNumber(); int[] error_msg_type = { HDF5Constants.H5E_MINOR }; String msg = null; + try { msg = H5.H5Eget_msg(errnum, error_msg_type); } @@ -126,15 +128,15 @@ public class TestH5E { assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, error_msg_type[0]); - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector and the error string might be different. - * Only check for the specific error message if the native - * connector is being used. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) - assertEquals("H5.H5Eget_msg: ", "Unable to open file", msg); + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector and the error string might be different. + * Only check for the specific error message if the native + * connector is being used. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertTrue("H5.H5Eget_msg: ", msg.contains("Unable to open file")); } catch (Throwable err) { err.printStackTrace(); -- cgit v0.12 From a1ce9b2242774c9ef8f7200dc7e3d9e31fd33676 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 May 2020 11:08:12 -0500 Subject: Correct step name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4e4e44..5c38961 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,7 +64,7 @@ jobs: - name: Get Sources uses: actions/checkout@v2 - - name: Setup CMake + - name: Configure run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" -- cgit v0.12