Skip to content

Commit

Permalink
Merge branch 'main' into silence-ncdap4-warnings
Browse files Browse the repository at this point in the history
* main: (48 commits)
  Update release notes.
  Refactor macro _FillValue to NC_FillValue in support of Unidata#2858
  Remove appveyor config file.
  Add CI for a Windows Runner on Github Actions.
  Add cmake prefix path to appveyor config.
  Attempt to fix zlib-related error in appveyor.
  Correct typo.
  Remove check for libcurl unless it is necessary for required functionality.
  Rename the vendored strlcat symbol
  Fix conversion warnings in libdispatch
  Set flags to avoid warning messages if curl isn't found.
  Use modern cmake nomenclature for curl.
  Fix truncated-format warning in ncgen
  Fix some conversion warnings in ncgen3
  Fix some conversion warnings in ncgen3 generated files
  Regenerate ncgen3
  CMake: Add option to automatically regenerate ncgen3/ncgen
  Skip checking for duplicates if only one element in list
  Change format of backwards-loops
  Silence some conversion warnings in ncgen generated files
  ...
  • Loading branch information
ZedThree committed Apr 25, 2024
2 parents 920ec70 + be9cb7f commit 40b7cfc
Show file tree
Hide file tree
Showing 141 changed files with 2,367 additions and 2,121 deletions.
88 changes: 88 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
Checks: "-*,\
bugprone-*,\
-bugprone-easily-swappable-parameters,\
-bugprone-assignment-in-if-condition,\
-bugprone-signed-char-misuse,\
-bugprone-branch-clone,\
-bugprone-narrowing-conversions,\
-bugprone-macro-parentheses,\
-bugprone-switch-missing-default-case,\
-bugprone-suspicious-include,\
-bugprone-reserved-identifier,\
-bugprone-misplaced-widening-cast,\
-bugprone-implicit-widening-of-multiplication-result,\
-bugprone-suspicious-realloc-usage,\
-bugprone-sizeof-expression,\
cert*,\
-cert-err33-c,\
-cert-err34-c,\
-cert-str34-c,\
-cert-dcl03-c,\
-cert-msc30-c,\
-cert-msc50-cpp,\
-cert-dcl37-c,\
-cert-dcl51-cpp,\
clang-analyzer-*,\
-clang-analyzer-core.CallAndMessage,\
-clang-analyzer-core.DivideZero,\
-clang-analyzer-core.NonNullParamChecker,\
-clang-analyzer-core.NullDereference,\
-clang-analyzer-core.UndefinedBinaryOperatorResult,\
-clang-analyzer-core.VLASize,\
-clang-analyzer-core.uninitialized.ArraySubscript,\
-clang-analyzer-core.uninitialized.Assign,\
-clang-analyzer-core.uninitialized.Branch,\
-clang-analyzer-cplusplus.Move,\
-clang-analyzer-cplusplus.NewDelete,\
-clang-analyzer-cplusplus.NewDeleteLeaks,\
-clang-analyzer-cplusplus.PlacementNew,\
-clang-analyzer-deadcode.DeadStores,\
-clang-analyzer-optin.cplusplus.UninitializedObject,\
-clang-analyzer-optin.cplusplus.VirtualCall,\
-clang-analyzer-optin.mpi.MPI-Checker,\
-clang-analyzer-optin.performance.Padding,\
-clang-analyzer-optin.portability.UnixAPI,\
-clang-analyzer-security.FloatLoopCounter,\
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,\
-clang-analyzer-security.insecureAPI.rand,\
-clang-analyzer-security.insecureAPI.strcpy,\
-clang-analyzer-unix.Malloc,\
-clang-analyzer-unix.MallocSizeof,\
-clang-analyzer-unix.MismatchedDeallocator,\
-clang-analyzer-unix.cstring.NullArg,\
-clang-analyzer-valist.Unterminated,\
misc-*,\
-misc-header-include-cycle,\
-misc-include-cleaner,\
-misc-no-recursion,\
-misc-unused-parameters,\
-misc-static-assert,\
-misc-redundant-expression,\
modernize-*,\
-modernize-macro-to-enum,\
mpi-*,\
openmp-*,\
performance-*,\
-performance-no-int-to-ptr,\
portability-*,\
readability-*,\
-readability-identifier-length,\
-readability-isolate-declaration,\
-readability-braces-around-statements,\
-readability-magic-numbers,\
-readability-else-after-return,\
-readability-function-cognitive-complexity,\
-readability-function-size,\
-readability-non-const-parameter,\
-readability-inconsistent-declaration-parameter-name,\
-readability-avoid-unconditional-preprocessor-if,\
-readability-named-parameter,\
-readability-duplicate-include,\
-readability-misleading-indentation,\
-readability-avoid-const-params-in-decls,\
-readability-redundant-declaration,\
-readability-redundant-preprocessor,\
"
#WarningsAsErrors: "*"
...
163 changes: 163 additions & 0 deletions .github/workflows/main-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: NetCDF-C CMake CI - Windows

on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:

cmake_build_and_test:
strategy:

matrix:
name:
- "Windows MSVC"
hdf5:
- "1.14.3"

# Visual Studio + CMake
include:
- name: "Windows MSVC"
os: windows-latest
generator: "-G \"Visual Studio 17 2022\""

name: "${{ matrix.name }}"

runs-on: ${{ matrix.os }}

# Each step in the job.
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: ""
auto-activate-base: true

- name: Set up Paths and env
shell: bash -el {0}
run: |
echo "" >> ~/.bash_profile
cat ~/.bash_profile
- name: Dump Matrix Context
run: echo '${{ toJSON(matrix) }}'

#- run: echo "CMAKE_PREFIX_PATH=${env.CONDA_PREFIX}/Library" >> $GITHUB_ENV
#- run: echo "/c/Users/runneradmin/miniconda3/Library/lib:${GITHUB_PATH}" >> $GITHUB_ENV
#- run: echo ""
#- run: echo "CTEST_OUTPUT_ON_FAILURE=1" >> $GITHUB_ENV

# Grab miniconda and use it to install HDF5
- name: Install Dependencies using Miniconda
run: |
conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
conda config --add channels conda-forge
conda update conda
conda install hdf5=${{ matrix.hdf5 }} m2-m4 libxml2
shell: bash -el {0}

# Double-check something
- name: Check Miniconda
run: |
which h5dump
which m4
shell: bash -el {0}

# Check current directory
- name: Query Current Environment
run: |
ls
echo ""
echo "PATH: $PATH"
echo ""
env
echo ""
ls $CONDA_PREFIX/Library
echo ""
ls $CONDA_PREFIX/Library/include/
shell: bash -el {0}

- name: Perform out-of-directory configuration
shell: bash -el {0}
run: |
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH="${CONDA_PREFIX}/Library" -DCMAKE_C_FLAGS="-I${CONDA_PREFIX}/Library/include" -DCMAKE_INSTALL_PREFIX=~/tmp -DNETCDF_ENABLE_FILTER_TESTING=OFF
if: ${{ success() }}

- name: View cache - configuration
shell: bash -el {0}
run: |
cd build
cmake -L .
if: ${{ success() }}

- name: Print Summary
shell: bash -el {0}
run: |
cd build
cat libnetcdf.settings
- name: Perform out-of-directory build - libnetcdf
shell: bash -el {0}
run: |
cd build
cmake --build . --config Release --target netcdf -j 4
- name: Perform out-of-directory install - libnetcdf
shell: bash -el {0}
run: |
cd build
cmake --build . --config Release --target install -j 4
if: ${{ success() }}

- name: View config.h - libnetcdf failure
shell: bash -el {0}
run: |
cd build
cat config.h
if: ${{ failure() }}

- name: Perform out-of-directory build - test suite
shell: bash -el {0}
run: |
cd build
cmake --build . --config Release -j 4
if: ${{ success() }}

- name: View config.h - tests failure failure
shell: bash -el {0}
run: |
cd build
cat config.h
if: ${{ failure() }}

- name: Prepare ctest Paths and env
shell: bash -el {0}
run: |
cat ~/.bash_profile
echo "" >> ~/.bash_profile
- name: Run ctest
shell: bash -el {0}
run: |
echo "Run ctest PATH: $PATH"
echo "Run ctest combined PATH: $PATH"
echo "Run ctest combined GITHUB_PATH: $PATH"
cd build
PATH=~/tmp/bin:$PATH ctest . -j 4 -E 'bom' --output-on-failure
- name: Verbose Output if CTest Failure
shell: bash -el {0}
run: |
cd build
PATH=~/tmp/bin:$PATH ctest . --rerun-failed --output-on-failure -VV
if: ${{ failure() }}
12 changes: 6 additions & 6 deletions .github/workflows/run_tests_cdash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
hdf5: [ 1.10.8, 1.12.2, 1.14.3 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install System dependencies
shell: bash -l {0}
Expand All @@ -32,7 +32,7 @@ jobs:
###
- name: Cache libhdf5-${{ matrix.hdf5 }}
id: cache-hdf5
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install System dependencies
shell: bash -l {0}
Expand All @@ -81,7 +81,7 @@ jobs:
###
- name: Cache libhdf5-parallel-${{ matrix.hdf5 }}
id: cache-hdf5
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-parallel-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
hdf5: [ 1.10.8, 1.12.2, 1.14.3 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
CDASH_TOKEN: ${{ secrets.CDASH_TOKEN }}
env:
Expand All @@ -153,7 +153,7 @@ jobs:

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

0 comments on commit 40b7cfc

Please sign in to comment.