Merge enhancements for CMake and CI (#785) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: netCDF cmake dev | |
# Triggers the workflow on push or pull request or on demand | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- '.github/CODEOWNERS' | |
- 'doc/**' | |
- 'release_docs/**' | |
- 'COPYING' | |
- '**.md' | |
permissions: | |
contents: read | |
# Using concurrency to cancel any in-progress job or run | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install System dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install ninja-build | |
sudo apt install libssl3 libssl-dev libcurl4 | |
sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin | |
- name: Checkout HDF4 | |
uses: actions/[email protected] | |
- name: CMake Configure HDF4 | |
run: | | |
mkdir "${{ runner.workspace }}/build" | |
cd "${{ runner.workspace }}/build" | |
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ | |
-G Ninja \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DHDF4_BUILD_FORTRAN:BOOL=OFF \ | |
-DHDF4_BUILD_JAVA:BOOL=OFF \ | |
-DHDF4_BUILD_EXAMPLES:BOOL=OFF \ | |
-DBUILD_JPEG_WITH_PIC:BOOL=ON \ | |
-DJPEG_USE_LOCALCONTENT:BOOL=OFF \ | |
-DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \ | |
-DZLIB_USE_LOCALCONTENT:BOOL=OFF \ | |
-DBUILD_TESTING:BOOL=OFF \ | |
-DBUILD_STATIC_LIBS:BOOL=OFF \ | |
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ | |
$GITHUB_WORKSPACE | |
shell: bash | |
- name: CMake Build HDF4 | |
run: cmake --build . --parallel 3 --config Release | |
working-directory: ${{ runner.workspace }}/build | |
- name: Install HDF4 | |
run: | | |
sudo cmake --install . --config Release --prefix="/usr/local" | |
working-directory: ${{ runner.workspace }}/build | |
- name: Checkout HDF5 | |
uses: actions/[email protected] | |
with: | |
repository: HDFGroup/hdf5 | |
path: hdf5 | |
ref: hdf5_1.14.5 | |
- name: CMake Configure HDF5 | |
run: | | |
mkdir "${{ runner.workspace }}/build5" | |
cd "${{ runner.workspace }}/build5" | |
cmake -C $GITHUB_WORKSPACE/hdf5/config/cmake/cacheinit.cmake \ | |
-G Ninja \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DHDF5_BUILD_FORTRAN:BOOL=OFF \ | |
-DHDF5_BUILD_JAVA:BOOL=OFF \ | |
-DHDF5_BUILD_EXAMPLES:BOOL=OFF \ | |
-DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \ | |
-DZLIB_USE_LOCALCONTENT:BOOL=OFF \ | |
-DBUILD_TESTING:BOOL=OFF \ | |
-DBUILD_STATIC_LIBS:BOOL=OFF \ | |
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ | |
$GITHUB_WORKSPACE/hdf5 | |
shell: bash | |
- name: CMake Build HDF5 | |
run: cmake --build . --parallel 3 --config Release | |
working-directory: ${{ runner.workspace }}/build5 | |
- name: Install HDF5 | |
run: | | |
sudo cmake --install . --config Release --prefix="/usr/local" | |
working-directory: ${{ runner.workspace }}/build5 | |
- name: Checkout netCDF | |
uses: actions/[email protected] | |
with: | |
repository: unidata/netcdf-c | |
path: netcdf-c | |
- name: Test netCDF | |
run: | | |
mkdir "netcdf-c/build" | |
cd "netcdf-c/build" | |
cmake .. -DUILD_SHARED_LIBS=ON -DNETCDF_ENABLE_HDF5=ON -DNETCDF_ENABLE_HDF4=ON | |
make | |
make test |