Fixed Clang -Wunused-but-set-variable warnings #1262
Workflow file for this run
This file contains hidden or 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: Run Cygwin-based tests | |
| on: [pull_request,workflow_dispatch] | |
| concurrency: | |
| group: ${{ github.workflow}}-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| env: | |
| SHELLOPTS: igncr | |
| CHERE_INVOKING: 1 | |
| CYGWIN_NOWINPATH: 1 | |
| REMOTETESTDOWN: ${{ vars.REMOTETESTDOWN }} | |
| jobs: | |
| build-and-test-autotools: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: C:/cygwin/bin/bash.exe -eo pipefail -o igncr "{0}" | |
| name: Cygwin-based Autotools tests | |
| strategy: | |
| matrix: | |
| plugin_dir_option: ["", "--without-plugin-dir"] | |
| use_nczarr_and_s3: ["nczarr_off", "nczarr_on", "nczarr_on_s3_on" ] | |
| steps: | |
| - name: Fix line endings | |
| shell: pwsh | |
| run: git config --global core.autocrlf input | |
| - uses: actions/checkout@v4 | |
| - uses: cygwin/cygwin-install-action@v4 | |
| with: | |
| platform: x86_64 | |
| install-dir: 'C:\cygwin' | |
| packages: >- | |
| git automake libtool autoconf2.5 make libhdf5-devel | |
| libhdf4-devel zipinfo libxml2-devel perl zlib-devel | |
| libzstd-devel libbz2-devel libaec-devel libzip-devel | |
| libdeflate-devel gcc-core gcc-g++ libcurl-devel libiconv-devel | |
| libssl-devel libcrypt-devel attr libattr-devel unzip zip | |
| - name: (Autotools) Run autoconf and friends | |
| run: | | |
| cp -f /bin/dash /bin/sh | |
| mkdir m4 | |
| /bin/dash /usr/bin/libtoolize --force --copy --verbose | |
| /usr/bin/autoreconf-2.69 --force --install --verbose --debug | |
| ### | |
| # Setup environment variables | |
| ### | |
| - run: echo "NETCDF_ENABLE_NCZARR=--disable-nczarr" >> $GITHUB_ENV | |
| if: matrix.use_nczarr_and_s3 == 'nczarr_off' | |
| - run: echo "NETCDF_ENABLE_NCZARR=--enable-nczarr" >> $GITHUB_ENV | |
| if: matrix.use_nczarr_and_s3 == 'nczarr_on' | |
| - run: | | |
| echo "NETCDF_ENABLE_NCZARR=--enable-nczarr" >> $GITHUB_ENV | |
| echo "NETCDF_ENABLE_S3=--enable-s3" >> $GITHUB_ENV | |
| echo "NETCDF_ENABLE_S3_INTERNAL=--enable-s3-internal" >> $GITHUB_ENV | |
| if: matrix.use_nczarr_and_s3 == 'nczarr_on_s3_on' | |
| - name: (Autotools) Configure in-tree build | |
| run: >- | |
| /bin/dash ./configure --enable-hdf5 --enable-shared | |
| --disable-static --enable-dap --disable-dap-remote-tests | |
| --enable-plugins ${{ matrix.plugin_dir_option }} | |
| ${NETCDF_ENABLE_NCZARR} ${NETCDF_ENABLE_S3} ${NETCDF_ENABLE_S3_INTERNAL} | |
| - name: Look at config.log if error | |
| if: ${{ failure() }} | |
| run: cat config.log | |
| - name: Print summary | |
| run: cat libnetcdf.settings | |
| - name: (Autotools) Build library and utilities | |
| run: make -j8 SHELL=/bin/dash | |
| - name: (Autotools) Test DESTDIR install | |
| run: | | |
| make install DESTDIR=/tmp/pretend-root SHELL=/bin/dash | |
| if [ -d "/tmp/pretend-root/$(pwd)" ]; | |
| then | |
| find /tmp/pretend-root/$(pwd) | |
| if [ $(find /tmp/pretend-root/$(pwd) -type f | wc -l) -gt 0 ]; then exit 1; fi | |
| fi | |
| - name: (Autotools) Build tests | |
| timeout-minutes: 30 | |
| run: | | |
| make check -j$(nproc) TESTS="" SHELL=/bin/dash | |
| - name: (Autotools) Run tests | |
| timeout-minutes: 30 | |
| run: | | |
| make check -j$(nproc) SHELL=/bin/dash | |
| - name: (Autotools) Examine test failures. | |
| run: | | |
| cat $(find . -name 'test-suite.log') SHELL=/bin/dash | |
| if: ${{ failure() }} | |
| - name: Upload autoconf test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cygwin-autotools-test-logs-${{ matrix.plugin_dir_option }}-${{ matrix.use_nczarr_and_s3 }} | |
| path: | | |
| */*.log | |
| */*.trs | |
| build-and-test-cmake: | |
| name: Cygwin-based CMake tests | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: C:/cygwin/bin/bash.exe -eo pipefail -o igncr "{0}" | |
| strategy: | |
| matrix: | |
| enable_nczarr_and_s3: ["OFF", "ON"] | |
| steps: | |
| - run: git config --global core.autocrlf input | |
| shell: pwsh | |
| - uses: actions/checkout@v4 | |
| - uses: cygwin/cygwin-install-action@v4 | |
| with: | |
| platform: x86_64 | |
| install-dir: 'C:\cygwin' | |
| packages: >- | |
| git automake libtool autoconf2.5 make libhdf5-devel | |
| libhdf4-devel zipinfo libxml2-devel perl zlib-devel | |
| libzstd-devel libbz2-devel libaec-devel libzip-devel | |
| libdeflate-devel gcc-core gcc-g++ libcurl-devel libiconv-devel | |
| libssl-devel libcrypt-devel cmake ninja make m4 diffutils zip unzip | |
| ### | |
| # Configure and build | |
| ### | |
| - name: (CMake) Configure Build | |
| env: | |
| MAKE: "/usr/bin/make" | |
| CXX: "/usr/bin/g++" | |
| run: | | |
| /usr/bin/cmake \ | |
| -G"Unix Makefiles" \ | |
| -B build \ | |
| -S . \ | |
| -DCMAKE_INSTALL_PREFIX=/tmp \ | |
| -DBUILD_SHARED_LIBS=ON \ | |
| -DNETCDF_ENABLE_HDF5=ON \ | |
| -DNETCDF_BUILD_UTILITIES=ON \ | |
| -DNETCDF_ENABLE_TESTS=ON \ | |
| -DNETCDF_ENABLE_HDF5=ON \ | |
| -DNETCDF_ENABLE_NCZARR=TRUE \ | |
| -DNETCDF_ENABLE_PLUGINS=ON \ | |
| -DNETCDF_ENABLE_S3=${{ matrix.enable_nczarr_and_s3 }} \ | |
| -DNETCDF_ENABLE_S3_INTERNAL=${{ matrix.enable_nczarr_and_s3 }} | |
| if: ${{ success() }} | |
| - name: (CMake) Look at CMakeCache.txt if error | |
| run: cat build/CMakeCache.txt | |
| if: ${{ failure() }} | |
| - name: (CMake) Print Summary | |
| run: cat build/libnetcdf.settings | |
| - name: (CMake) Build All | |
| env: | |
| MAKE: "/usr/bin/make" | |
| CXX: "/usr/bin/g++" | |
| run: cmake --build build -j$(nproc) | |
| if: ${{ success() }} | |
| - name: (CMake) Run Tests | |
| run: PATH=$PWD/build:$PATH ctest --test-dir build | |
| if: ${{ success() }} | |
| - name: (CMake) Verbose output of CTest failures | |
| run: >- | |
| PATH=$PWD/build:$PATH ctest --test-dir build --output-on-failure -j$(nproc) --rerun-failed -VV | |
| if: ${{ failure() }} |