test: update the test files #2752
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: "Library" | |
| on: | |
| push: | |
| # TODO Uncomment the ccache part when installation of Ubuntu packages on GitHub Actions becomes fast again | |
| jobs: | |
| basicchecks: | |
| name: Basic checks | |
| runs-on: ubuntu-latest | |
| outputs: | |
| hassecrets: ${{ steps.checksecrets.outputs.hassecrets }} | |
| # env: | |
| # CCACHE: ccache | |
| # CCACHE_DIR: ${{ github.workspace }}/ccache | |
| steps: | |
| - name: Checkout Colvars | |
| uses: actions/checkout@v4 | |
| # - name: Load compiler cache | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: ${{ github.workspace }}/ccache | |
| # key: ${{ runner.os }}-build-basic-${{ github.sha }} | |
| # restore-keys: ${{ runner.os }}-build-basic- | |
| - name: Get small downloadable packages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Colvars/build-tools-packages' | |
| ref: 'master' | |
| path: 'devel-tools/packages' | |
| # - name: Install ccache | |
| # run: | | |
| # sudo apt -y install ccache | |
| - name: Test build recipes | |
| run: bash devel-tools/check_build_recipes | |
| - name: Convert BibTeX references to code | |
| shell: bash | |
| working-directory: doc | |
| run: | | |
| make update-code-refs | |
| if [ -n "$(git status --porcelain ../src/colvarmodule_refs.h)" ] ; then | |
| echo "Code citations out of date; please run make update-code-refs in the doc folder" >& 2 | |
| exit 1 | |
| fi | |
| - name: Build and test library | |
| run: cmake -P devel-tools/build_test_library.cmake | |
| - name: Check documentation of command-line scripting interface | |
| shell: bash | |
| working-directory: doc | |
| run: | | |
| make update-cvscript-cmdline-doc | |
| if [ -n "$(git status --porcelain cvscript-tcl.tex)" ] ; then | |
| echo "Command-line scripting doc out of date; please run make update-cvscript-cmdline-doc and commit changes" >& 2 | |
| exit 1 | |
| fi | |
| # - name: Print ccache stats | |
| # run: ccache -s -v | |
| # - name: Keep only one cache besides the one from this job | |
| # shell: bash | |
| # env: | |
| # GH_TOKEN: ${{ github.token }} | |
| # run: | | |
| # bash ${{ github.workspace }}/devel-tools/cleanup-gh-cache.sh ${{ runner.os }}-build-basic- | |
| build-doc: | |
| name: Build documentation | |
| runs-on: ubuntu-latest | |
| needs: basicchecks | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Apptainer | |
| shell: bash | |
| run: | | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer-suid | |
| - name: Get container image | |
| shell: bash | |
| working-directory: devel-tools | |
| run: | | |
| apptainer pull texlive.sif oras://ghcr.io/colvars/devel-containers:texlive | |
| - name: Checkout website repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ssh-key: ${{ secrets.PULL_PUSH_COLVARS_GITHUB_IO }} | |
| repository: 'Colvars/colvars.github.io' | |
| path: 'website' | |
| - name: Build doc for current branch | |
| working-directory: doc | |
| run: | | |
| make clean-all | |
| apptainer exec ${{ github.workspace }}/devel-tools/texlive.sif make | |
| - name: Install SSH key for access to website repository | |
| if: contains(github.event.head_commit.message, '[update-doc]') | |
| env: | |
| WEBSITE_SSH_KEY: ${{ secrets.PULL_PUSH_COLVARS_GITHUB_IO }} | |
| run: | | |
| mkdir -p -m 700 ~/.ssh | |
| echo "${WEBSITE_SSH_KEY}" > ~/.ssh/website | |
| chmod 600 ~/.ssh/website | |
| - name: Push updated doc to website repository | |
| working-directory: doc | |
| if: contains(github.event.head_commit.message, '[update-doc]') | |
| env: | |
| COLVARS_WEBSITE_TREE: ${{ github.workspace }}/website | |
| run: | | |
| apptainer exec ${{ github.workspace }}/devel-tools/texlive.sif make install | |
| export GIT_SSH="ssh -i ~/.ssh/website" | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "CI runner" | |
| bash update_website.sh ${{ github.workspace }}/website | |
| codeql: | |
| name: CodeQL analysis | |
| runs-on: ubuntu-latest | |
| needs: basicchecks | |
| if: ${{ ! github.event.repository.private }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get small downloadable packages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Colvars/build-tools-packages' | |
| ref: 'master' | |
| path: 'devel-tools/packages' | |
| - name: Checkout OpenMM (for Lepton library) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'openmm/openmm' | |
| ref: 'master' | |
| path: 'openmm-source' | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: cpp | |
| build-mode: manual | |
| - name: Build Colvars library with CMake | |
| run: cmake -DRUN_TESTS=OFF -P devel-tools/build_test_library.cmake | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| build-linux-x86_64-clang-analyzer: | |
| name: Linux x86_64 (Clang analyzer) | |
| runs-on: ubuntu-latest | |
| needs: basicchecks | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout OpenMM (for Lepton library) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'openmm/openmm' | |
| ref: 'master' | |
| path: 'openmm-source' | |
| - name: Install Apptainer | |
| shell: bash | |
| run: | | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer-suid | |
| - name: Get container images for build dependencies | |
| shell: bash | |
| working-directory: devel-tools | |
| run: | | |
| apptainer pull CentOS9-devel.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel | |
| - name: Run build with Clang static analyser | |
| env: | |
| CXX: clang++ | |
| CC: clang | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| scan-build --use-cc=clang --use-c++=clang++ cmake -P devel-tools/build_test_library.cmake 2>&1 | tee build_analyzer.log | |
| grep "error:" build_analyzer.log > build_errors.log || true | |
| if [ -s build_errors.log ] ; then | |
| echo "Found scan-build errors during build" | |
| cat build_analyzer.log | |
| exit 1 | |
| fi | |
| - name: Analyze logs | |
| run: | # Retrieve warnings generated but not the ones of OpenMM | |
| awk '/colvars\/colvars\/[^openmm].*warning:/,/warning.*generated|^$/' build_analyzer.log | tee warnings_analyzer.log || true | |
| if [ -s warnings_analyzer.log ] ; then | |
| echo "Found compiler warning during build" | |
| exit 1 | |
| fi | |
| - name: Archive warnings artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: warnings_clang_static_analyzer | |
| path: warnings_analyzer.log | |
| address-sanitizer: | |
| name: Linux x86_64 (Clang address sanitizer) | |
| runs-on: ubuntu-latest | |
| needs: basicchecks | |
| env: | |
| CCACHE: ccache | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout OpenMM (for Lepton library) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'openmm/openmm' | |
| ref: 'master' | |
| path: 'openmm-source' | |
| - name: Install Apptainer | |
| shell: bash | |
| run: | | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer-suid | |
| - name: Get container images for build dependencies | |
| shell: bash | |
| working-directory: devel-tools | |
| run: | | |
| apptainer pull CentOS9-devel.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel | |
| - name: Build with Clang and address sanitizer | |
| env: | |
| CXX: clang++ | |
| CC: clang | |
| CMAKE_ADDRESS_SANITIZER: ON | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| cmake -P devel-tools/build_test_library.cmake | |
| - name: Archive warnings artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: Clang_address_sanitizer_output | |
| path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log | |
| build-linux-x86_64-gcc-clang: | |
| name: Linux x86_64 (GCC, Clang) | |
| runs-on: ubuntu-latest | |
| needs: basicchecks | |
| env: | |
| CCACHE: ccache | |
| CMAKE_GENERATOR: Ninja | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Load compiler ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ runner.os }}-build-gcc-clang-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-build-gcc-clang- | |
| - name: Get small downloadable packages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Colvars/build-tools-packages' | |
| ref: 'master' | |
| path: 'devel-tools/packages' | |
| - name: Install Apptainer | |
| shell: bash | |
| run: | | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer-suid | |
| - name: Get container images for build environment | |
| shell: bash | |
| working-directory: devel-tools | |
| run: | | |
| apptainer pull CentOS9-devel.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel | |
| - name: GCC 11, C++11 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 11 | |
| CXX: g++ | |
| CXX_VERSION: 11 | |
| CC: gcc | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: GCC 11, C++17 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: g++ | |
| CXX_VERSION: 11 | |
| CC: gcc | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: GCC 12, C++20 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: g++ | |
| CXX_VERSION: 12 | |
| CC: gcc | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| scl enable gcc-toolset-${CXX_VERSION} -- \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: GCC 13, C++20 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: g++ | |
| CXX_VERSION: 13 | |
| CC: gcc | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| scl enable gcc-toolset-${CXX_VERSION} -- \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: GCC 14, C++20 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: g++ | |
| CXX_VERSION: 14 | |
| CC: gcc | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| scl enable gcc-toolset-${CXX_VERSION} -- \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: Clang 20, C++11 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 11 | |
| CXX: clang++-20 | |
| CXX_VERSION: 20 | |
| CC: clang-20 | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: Clang 20, C++17 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: clang++-20 | |
| CXX_VERSION: 17 | |
| CC: clang-20 | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: Clang 20, C++20 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: clang++-20 | |
| CXX_VERSION: 20 | |
| CC: clang-20 | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: Keep only one cache besides the one from this job | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| bash ${{ github.workspace }}/devel-tools/cleanup-gh-cache.sh ${{ runner.os }}-build-gcc-clang- | |
| build-linux-x86_64-intel: | |
| name: Linux x86_64 (Intel oneAPI) | |
| runs-on: ubuntu-latest | |
| needs: basicchecks | |
| env: | |
| CCACHE: ccache | |
| CMAKE_GENERATOR: Ninja | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Load compiler ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/ccache | |
| key: ${{ runner.os }}-build-oneapi-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-build-oneapi- | |
| - name: Get small downloadable packages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Colvars/build-tools-packages' | |
| ref: 'master' | |
| path: 'devel-tools/packages' | |
| - name: Install Apptainer | |
| shell: bash | |
| run: | | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer-suid | |
| - name: Get container images for build dependencies | |
| shell: bash | |
| working-directory: devel-tools | |
| run: | | |
| apptainer pull CentOS9-oneAPI.sif oras://ghcr.io/colvars/devel-containers:CentOS9-oneAPI | |
| - name: Intel oneAPI 2024.2, C++11 | |
| shell: bash | |
| env: | |
| CC: icx | |
| CXX: icpx | |
| CXX_STANDARD: 11 | |
| BASH_ENV: "/etc/profile.d/oneapi.sh" | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-oneAPI.sif \ | |
| bash -c "cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake" | |
| - name: Intel oneAPI 2024.2, C++14 | |
| shell: bash | |
| env: | |
| CC: icx | |
| CXX: icpx | |
| CXX_STANDARD: 14 | |
| BASH_ENV: "/etc/profile.d/oneapi.sh" | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-oneAPI.sif \ | |
| bash -c "cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake" | |
| - name: Intel oneAPI 2024.2, C++17 | |
| shell: bash | |
| env: | |
| CC: icx | |
| CXX: icpx | |
| CXX_STANDARD: 17 | |
| BASH_ENV: "/etc/profile.d/oneapi.sh" | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-oneAPI.sif \ | |
| bash -c "cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake" | |
| - name: Intel oneAPI 2024.2, C++20 | |
| shell: bash | |
| env: | |
| CC: icx | |
| CXX: icpx | |
| CXX_STANDARD: 20 | |
| BASH_ENV: "/etc/profile.d/oneapi.sh" | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-oneAPI.sif \ | |
| bash -c "cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake" | |
| - name: Save failed library test artifact | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: failed-library-test-output-intel-oneAPI | |
| path: | | |
| ${{ github.workspace }}/build/Testing/Temporary/*.log | |
| - name: Keep only one cache besides the one from this job | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| bash ${{ github.workspace }}/devel-tools/cleanup-gh-cache.sh ${{ runner.os }}-build-oneapi- | |
| build-windows-x86_64-msvc: | |
| name: Windows x86_64 (MSVC) | |
| runs-on: windows-latest | |
| needs: basicchecks | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get small downloadable packages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Colvars/build-tools-packages' | |
| ref: 'master' | |
| path: 'devel-tools/packages' | |
| - name: Build and test library with CMake | |
| # We need to set CMAKE_SYSTEM_NAME manually in script mode | |
| run: cmake -D CMAKE_SYSTEM_NAME=Windows -P devel-tools/build_test_library.cmake | |
| build-macos-ARM64-clang: | |
| name: macOS ARM64 (AppleClang) | |
| runs-on: macos-latest | |
| needs: basicchecks | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get small downloadable packages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Colvars/build-tools-packages' | |
| ref: 'master' | |
| path: 'devel-tools/packages' | |
| - name: Build and test library with CMake | |
| # We need to set CMAKE_SYSTEM_NAME manually in script mode | |
| run: cmake -D CMAKE_SYSTEM_NAME=Darwin -P devel-tools/build_test_library.cmake | |
| build-linux-ARM64-gcc: | |
| name: Linux ARM64 (GCC, Clang) | |
| runs-on: ubuntu-24.04-arm | |
| needs: basicchecks | |
| env: | |
| CCACHE: ccache | |
| CMAKE_GENERATOR: Ninja | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Apptainer | |
| shell: bash | |
| run: | | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer-suid | |
| - name: Get container images for build dependencies | |
| shell: bash | |
| working-directory: devel-tools | |
| run: | | |
| apptainer pull CentOS9-devel-arm64.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel-arm64 | |
| - name: GCC 11, C++20 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: g++ | |
| CXX_VERSION: 11 | |
| CC: gcc | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel-arm64.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: Clang 16, C++20 (CentOS 9) | |
| env: | |
| CXX_STANDARD: 20 | |
| CXX: clang++ | |
| CXX_VERSION: 16 | |
| CC: clang | |
| run: | | |
| apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel-arm64.sif \ | |
| cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
| - name: Save failed library test artifact | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: failed-library-test-output-ARM64 | |
| path: | | |
| ${{ github.workspace }}/build_C++20/Testing/Temporary/*.log | |
| ${{ github.workspace }}/build_g++11_C++20/Testing/Temporary/*.log |