Files
00af100181 Harden scheduled/downstream build workflows against zizmor findings (#6544)
* Harden scheduled/downstream build workflows against zizmor findings

Fix all zizmor static-analysis findings in the scheduled/downstream build
workflows without changing behavior:

- template-injection: move ${{ }} expressions out of run: script bodies
  into step-level env: blocks referenced as shell variables
- artipacked: add persist-credentials: false to actions/checkout steps
  (none of these jobs push to git)
- excessive-permissions: add top-level 'permissions: contents: read' to
  macos-26-matrix.yml (other files already restrict permissions)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Address Copilot review comments on PR #6544

- Drop unnecessary command substitution in daily-schedule.yml's
  FILE_NAME_BASE assignment
- Name the two env-block steps in daily-build.yml that previously ran
  unnamed (easier to scan in logs)
- Quote $GITHUB_OUTPUT in the getinputs step

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Remove extra blank lines.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
2026-08-04 16:41:29 -04:00

104 lines
3.6 KiB
YAML

name: netCDF dev
# Triggers the workflow on push or pull request or on demand
on:
workflow_dispatch:
push:
paths-ignore:
- '.github/CODEOWNERS'
- '.github/FUNDING.yml'
- 'docs/**'
- 'release_docs/**'
- 'ACKNOWLEDGEMENTS'
- 'LICENSE**'
- '**.md'
pull_request:
branches: [ develop ]
paths-ignore:
- '.github/CODEOWNERS'
- '.github/FUNDING.yml'
- 'docs/**'
- 'release_docs/**'
- 'ACKNOWLEDGEMENTS'
- 'LICENSE**'
- '**.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 HDF5
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false # Prevents tokens from being written to Git config files
- name: Configure
env:
RUNNER_WORKSPACE: ${{ runner.workspace }}
run: |
mkdir "$RUNNER_WORKSPACE/build"
cd "$RUNNER_WORKSPACE/build"
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \
-G Ninja \
--log-level=VERBOSE \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_ENABLE_PARALLEL:BOOL=OFF \
-DHDF5_BUILD_CPP_LIB:BOOL=OFF \
-DHDF5_BUILD_FORTRAN:BOOL=OFF \
-DHDF5_BUILD_JAVA:BOOL=OFF \
-DHDF5_BUILD_DOC:BOOL=OFF \
-DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \
-DZLIB_USE_LOCALCONTENT:BOOL=OFF \
-DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
$GITHUB_WORKSPACE
shell: bash
- name: Build
run: cmake --build . --parallel 3 --config Release
working-directory: ${{ runner.workspace }}/build
- name: Install HDF5
run: |
sudo cmake --install . --config Release --prefix="/usr/local"
working-directory: ${{ runner.workspace }}/build
- name: Checkout netCDF
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false # Prevents tokens from being written to Git config files
repository: unidata/netcdf-c
path: netcdf-c
- name: Test netCDF
run: |
cd netcdf-c
autoreconf -if
# NOTE: --disable-byterange should be removed when the HTTP VFD has been updated
CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./configure --enable-hdf5 --enable-dap --disable-dap-remote-tests --disable-byterange --enable-external-server-tests
cat config.log
cat libnetcdf.settings
CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j
CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
LD_LIBRARY_PATH="/home/runner/work/hdf5/hdf5/netcdf-c/liblib/.libs:/usr/local/lib:${LD_LIBRARY_PATH}"
CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j