Skip to content

Commit

Permalink
Merge pull request #2093 from Unidata/gh2091.wif
Browse files Browse the repository at this point in the history
2091 + Github Action to test
  • Loading branch information
WardF committed Aug 25, 2021
2 parents fc53762 + 11040c5 commit 6ea721d
Show file tree
Hide file tree
Showing 11 changed files with 1,488 additions and 11 deletions.
173 changes: 171 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
nc-autotools:

needs: build-deps
needs: [ nc-cmake-tests-oneoff, nc-ac-tests-oneoff ]
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:

nc-cmake:

needs: build-deps
needs: [ nc-cmake-tests-oneoff, nc-ac-tests-oneoff ]
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -250,3 +250,172 @@ jobs:
cd build
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest -j 12 .
if: ${{ success() }}

- name: Verbose Output if CTest Failure
shell: bash -l {0}
run: |
cd build
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest -j 12 --rerun-failed --output-on-failure -VV
if: ${{ failure() }}


#####
# One-Off Autotools-based tests.
#####
nc-ac-tests-oneoff:

needs: build-deps
runs-on: ubuntu-latest

strategy:
matrix:
hdf5: [ 1.10.7 ]
steps:

- uses: actions/checkout@v2

- name: Install System dependencies
shell: bash -l {0}
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev

###
# Set Environmental Variables
###

- run: echo "CFLAGS=-I${HOME}/environments/${{ matrix.hdf5 }}/include" >> $GITHUB_ENV
- run: echo "LDFLAGS=-L${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
- run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV


###
# Fetch Cache
###

- name: Fetch HDF Cache
id: cache-hdf
uses: actions/cache@v2
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}

- name: Check Cache
shell: bash -l {0}
run: ls ${HOME}/environments && ls ${HOME}/environments/${{ matrix.hdf5 }} && ls ${HOME}/environments/${{ matrix.hdf5}}/lib

###
# Configure and build
###

- name: Run autoconf
shell: bash -l {0}
run: autoreconf -if

- name: Configure
shell: bash -l {0}
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./configure --enable-hdf4 --enable-hdf5 --enable-dap --enable-dap-long-tests
if: ${{ success() }}

- name: Look at config.log if error
shell: bash -l {0}
run: cat config.log
if: ${{ failure() }}

- name: Print Summary
shell: bash -l {0}
run: cat libnetcdf.settings

- name: Build Library and Utilities
shell: bash -l {0}
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j
if: ${{ success() }}

- name: Build Tests
shell: bash -l {0}
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
if: ${{ success() }}

- name: Run Tests
shell: bash -l {0}
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
if: ${{ success() }}

#####
# One-Off CMake-based tests.
#####

nc-cmake-tests-oneoff:

needs: build-deps
runs-on: ubuntu-latest

strategy:
matrix:
hdf5: [ 1.10.7]

steps:

- uses: actions/checkout@v2

- name: Install System dependencies
shell: bash -l {0}
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev

###
# Set Environmental Variables
###

- run: echo "CMAKE_PREFIX_PATH=${HOME}/environments/${{ matrix.hdf5 }}/" >> $GITHUB_ENV
- run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV

###
# Fetch Cache
###

- name: Fetch HDF Cache
id: cache-hdf5
uses: actions/cache@v2
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}

- name: Check Cache
shell: bash -l {0}
run: ls ${HOME}/environments && ls ${HOME}/environments/${{ matrix.hdf5 }} && ls ${HOME}/environments/${{ matrix.hdf5}}/lib

###
# Configure and build
###

- name: Perform out-of-directory build
shell: bash -l {0}
run: |
mkdir build
cd build
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DENABLE_HDF4=TRUE -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D ENABLE_DAP_LONG_TESTS=TRUE
- name: Print Summary
shell: bash -l {0}
run: |
cd build
cat libnetcdf.settings
- name: Build All
shell: bash -l {0}
run: |
cd build
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j 12
if: ${{ success() }}

- name: Run Tests
shell: bash -l {0}
run: |
cd build
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest -j 12 .
if: ${{ success() }}

- name: Verbose Output if CTest Failure
shell: bash -l {0}
run: |
cd build
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest -j 12 --rerun-failed --output-on-failure -VV
if: ${{ failure() }}
2 changes: 1 addition & 1 deletion docs/windows-binaries.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
noInstalling and Using netCDF-C Libraries in Windows {#winbin}
Installing and Using netCDF-C Libraries in Windows {#winbin}
==================================================

\brief NetCDF-C Libraries in a Windows Environment may be used under multiple sets of circumstances.
Expand Down
6 changes: 5 additions & 1 deletion ncdap_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ IF(ENABLE_TESTS)
IF(BUILD_UTILITIES)
add_sh_test(ncdap tst_ncdap3)
add_sh_test(ncdap testpathcvt)
ENDIF()
SET_TESTS_PROPERTIES(ncdap_tst_ncdap3 ncdap_testpathcvt PROPERTIES RUN_SERIAL TRUE)
ENDIF()

IF(NOT MSVC)
add_bin_env_test(ncdap t_dap3a)
Expand All @@ -55,8 +56,11 @@ IF(ENABLE_TESTS)
IF(ENABLE_DAP_LONG_TESTS)
add_sh_test(ncdap tst_longremote3)
add_bin_test(ncdap test_manyurls)
SET_TESTS_PROPERTIES(ncdap_tst_longremote3 ncdap_test_manyurls PROPERTIES RUN_SERIAL TRUE)
ENDIF(ENABLE_DAP_LONG_TESTS)

SET_TESTS_PROPERTIES(ncdap_tst_remote3 PROPERTIES RUN_SERIAL TRUE)

ENDIF(BUILD_UTILITIES)

IF(ENABLE_DAP_AUTH_TESTS)
Expand Down
4 changes: 3 additions & 1 deletion ncdap_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ TESTS += test_partvar

if ENABLE_DAP_LONG_TESTS
TESTS += tst_longremote3.sh
tst_longremote3.log: tst_remote3.log
check_PROGRAMS += test_manyurls
TESTS += test_manyurls
test_manyurls.log: tst_longremote3.log
endif

test_partvar_SOURCES = test_partvar.c
Expand Down Expand Up @@ -92,7 +94,7 @@ SUBDIRS = testdata3 expected3 expectremote3
EXTRA_DIST = tst_ncdap3.sh \
tst_remote3.sh \
tst_longremote3.sh \
tst_zero_len_var.sh \
tst_zero_len_var.sh \
tst_filelists.sh tst_urls.sh tst_utils.sh \
t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh \
t_ncf330.c tst_ber.sh tst_fillmismatch.sh tst_encode.sh testpathcvt.sh \
Expand Down

0 comments on commit 6ea721d

Please sign in to comment.