diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 24264137..60b697b2 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -55,7 +55,7 @@ jobs: - name: Read inputs id: getinputs run: | - echo "INPUTS_IGNORE=${{ inputs.use_ignore }}" >> $GITHUB_OUTPUT + echo "INPUTS_IGNORE=${{ inputs.use_ignore || 'check' }}" >> $GITHUB_OUTPUT - run: echo "use_ignore is ${{ steps.getinputs.outputs.INPUTS_IGNORE }}." @@ -75,7 +75,7 @@ jobs: file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} use_hdf: ${{ needs.get-old-names.outputs.hdf5-name }} use_environ: snapshots - if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} + if: ${{ (github.event_name != 'pull_request') && ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} call-workflow-ctest: needs: [get-old-names, call-workflow-tarball] @@ -108,6 +108,7 @@ jobs: use_hdf: ${{ needs.get-old-names.outputs.hdf5-name }} file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} use_environ: snapshots + if: ${{ github.event_name != 'pull_request' }} call-workflow-release: needs: [get-old-names, call-workflow-tarball, call-workflow-ctest] @@ -120,7 +121,7 @@ jobs: file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }} use_tag: snapshot use_environ: snapshots - if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} + if: ${{ (github.event_name != 'pull_request') && ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} call-workflow-remove: needs: [get-old-names, call-workflow-tarball, call-workflow-ctest, call-workflow-release] @@ -131,7 +132,7 @@ jobs: file_base: ${{ needs.get-old-names.outputs.plugin-name }} use_tag: snapshot use_environ: snapshots - if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) && (needs.get-old-names.outputs.hdf5-name != needs.call-workflow-tarball.outputs.file_base) }} + if: ${{ (github.event_name != 'pull_request') && ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) && (needs.get-old-names.outputs.hdf5-name != needs.call-workflow-tarball.outputs.file_base) }} call-workflow-versions: uses: ./.github/workflows/check-releases.yml diff --git a/.github/workflows/tarball.yml b/.github/workflows/tarball.yml index 7e2be850..0b9150e6 100644 --- a/.github/workflows/tarball.yml +++ b/.github/workflows/tarball.yml @@ -44,7 +44,7 @@ jobs: name: Check for recent commits runs-on: ubuntu-latest outputs: - has_changes: ${{ steps.check-new-commits.outputs.has-new-commits }} + has_changes: ${{ steps.check-new-commits.outputs.has-new-commits || steps.set-pr-commits.outputs.has-new-commits }} branch_ref: ${{ steps.get-branch-name.outputs.BRANCH_REF }} branch_sha: ${{ steps.get-branch-sha.outputs.BRANCH_SHA }} steps: @@ -73,8 +73,14 @@ jobs: uses: adriangl/check-new-commits-action@v1 with: seconds: 86400 # One day in seconds - branch: '${{ steps.get-branch-name.outputs.branch_ref }}' - if: ${{ (inputs.use_environ == 'snapshots' && inputs.use_ignore == 'check') }} + branch: '${{ steps.get-branch-name.outputs.BRANCH_REF }}' + token: ${{ secrets.GITHUB_TOKEN }} + if: ${{ (inputs.use_environ == 'snapshots' && inputs.use_ignore == 'check' && github.event_name != 'pull_request') }} + + - name: Set has-new-commits for pull requests + id: set-pr-commits + run: echo "has-new-commits=true" >> $GITHUB_OUTPUT + if: ${{ github.event_name == 'pull_request' }} - run: echo "You have ${{ steps.check-new-commits.outputs.new-commits-number }} new commit(s) in ${{ steps.get-branch-name.outputs.BRANCH_REF }} ✅!" if: ${{ steps.check-new-commits.outputs.has-new-commits == 'true' }} @@ -95,7 +101,7 @@ jobs: uses: actions/checkout@v4.1.7 with: path: hdfsrc - ref: '${{needs.check_commits.outputs.branch_ref }}' + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || needs.check_commits.outputs.branch_ref }} - name: Retrieve version id: version diff --git a/README.md b/README.md index aaf23dbb..57fd153d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Select HDF5 Filter Plugins Repository +[![Daily Build](https://github.com/HDFGroup/hdf5_plugins/actions/workflows/daily-build.yml/badge.svg)](https://github.com/HDFGroup/hdf5_plugins/actions/workflows/daily-build.yml) + This repository contains a select number of registered HDF5® filter plugins for use in HDF Group's development and testing activities of the HDF5® library. The HDF Group is the developer, maintainer, and steward of the HDF5® software. Find more information about The HDF Group, the HDF5® Community, and other HDF5® software projects, tools, and services at [The HDF Group's website](https://www.hdfgroup.org/). diff --git a/config/cmake/binex/example/CMakeLists.txt b/config/cmake/binex/example/CMakeLists.txt index 35e7c429..7054735f 100644 --- a/config/cmake/binex/example/CMakeLists.txt +++ b/config/cmake/binex/example/CMakeLists.txt @@ -67,6 +67,15 @@ foreach (example ${dyn_examples} ${extra_examples}) endforeach () if (H5PL_BUILD_TESTING) + # Set plugin path relative to PROJECT_SOURCE_DIR + # Windows: HDF5/HDFPLExamples/example -> ../../lib/plugin + # Unix/Mac: HDF5/share/HDFPLExamples/example -> ../../../lib/plugin + if (WIN32) + set (PLUGIN_RELATIVE_PATH "../../lib/plugin") + else () + set (PLUGIN_RELATIVE_PATH "../../../lib/plugin") + endif () + macro (ADD_H5_TEST testname) add_test ( NAME ${testname}-clearall @@ -102,6 +111,8 @@ if (H5PL_BUILD_TESTING) -D "TEST_ERRREF=1" -D "GREP_ERRREF=Filter present but encoding disabled" -D "TEST_LIBRARY_DIRECTORY=${TESTLIBDIR}" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${PROJECT_SOURCE_DIR}/${PLUGIN_RELATIVE_PATH}" -P "${H5PL_RESOURCES_DIR}/runTest.cmake" ) set_tests_properties (${testname}-ERR PROPERTIES DEPENDS ${testname}-clearall) @@ -123,6 +134,8 @@ if (H5PL_BUILD_TESTING) -D "TEST_OUTPUT=${testname}.out" -D "TEST_REFERENCE=${testname}.tst" -D "TEST_LIBRARY_DIRECTORY=${TESTLIBDIR}" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${PROJECT_SOURCE_DIR}/${PLUGIN_RELATIVE_PATH}" -P "${H5PL_RESOURCES_DIR}/runTest.cmake" ) set_tests_properties (${testname} PROPERTIES DEPENDS ${testname}-clearall) @@ -142,6 +155,8 @@ if (H5PL_BUILD_TESTING) -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${testname}.ddl" -D "TEST_LIBRARY_DIRECTORY=${TESTLIBDIR}" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/../plugins" -P "${H5PL_RESOURCES_DIR}/runTest.cmake" ) else () @@ -158,6 +173,8 @@ if (H5PL_BUILD_TESTING) -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${testname}.ddl" -D "TEST_LIBRARY_DIRECTORY=${TESTLIBDIR}" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${PROJECT_SOURCE_DIR}/${PLUGIN_RELATIVE_PATH}" -P "${H5PL_RESOURCES_DIR}/runTest.cmake" ) else () @@ -174,6 +191,8 @@ if (H5PL_BUILD_TESTING) -D "TEST_MASK_MOD=1" -D "TEST_REFERENCE=${testname}.ddl" -D "TEST_LIBRARY_DIRECTORY=${TESTLIBDIR}" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${PROJECT_SOURCE_DIR}/${PLUGIN_RELATIVE_PATH}" -P "${H5PL_RESOURCES_DIR}/runTest.cmake" ) endif ()