Do not use GPU #45
This file contains 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, pull_request] | |
jobs: | |
basicchecks: | |
name: Basic checks | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
outputs: | |
hassecrets: ${{ steps.checksecrets.outputs.hassecrets }} | |
env: | |
CCACHE: ccache | |
CCACHE_DIR: ${{ github.workspace }}/ccache | |
steps: | |
- name: Checkout Colvars | |
uses: actions/checkout@v3 | |
- name: Load compiler cache | |
uses: actions/cache@v3 | |
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@v3 | |
with: | |
repository: 'Colvars/build-tools-packages' | |
ref: 'master' | |
path: 'devel-tools/packages' | |
- name: Install build dependencies for library | |
run: | | |
sudo apt -y install ccache tcl8.6-dev clang | |
- 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 (GCC) | |
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: Build and test library (Clang) | |
env: | |
CMAKE_BUILD_DIR: build-clang | |
CXX: clang++ | |
CC: clang | |
run: cmake -P devel-tools/build_test_library.cmake | |
- name: Build library with debug flags enabled | |
run: cmake -D COLVARS_DEBUG=ON -P devel-tools/build_test_library.cmake | |
- name: Check whether secrets are available | |
id: checksecrets | |
env: | |
PULL_ORACLE_DEVELOPER_STUDIO: ${{ secrets.PULL_ORACLE_DEVELOPER_STUDIO }} | |
run: | | |
echo "hassecrets=${{ env.PULL_ORACLE_DEVELOPER_STUDIO != '' }}" >> $GITHUB_OUTPUT | |
- name: Print ccache stats | |
run: ccache -s -v | |
build-doc: | |
name: Build documentation | |
runs-on: ubuntu-latest | |
needs: basicchecks | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
with: | |
repository: 'Colvars/colvars.github.io' | |
path: 'website' | |
- name: Build doc | |
working-directory: website | |
env: | |
COLVARSDIR: ${{ github.workspace }} | |
FORCE: 1 # Ignore error if branch isn't master | |
run: apptainer exec ${COLVARSDIR}/devel-tools/texlive.sif make | |
codeql: | |
name: CodeQL analysis | |
runs-on: ubuntu-latest | |
needs: basicchecks | |
if: ${{ ! github.event.repository.private }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install build dependencies for library | |
run: | | |
sudo apt-get -y install tcl8.6-dev | |
- name: Checkout OpenMM (for Lepton library) | |
uses: actions/checkout@v3 | |
with: | |
repository: 'openmm/openmm' | |
ref: 'master' | |
path: 'openmm-source' | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: cpp | |
- name: Build Colvars library with CMake | |
run: cmake -P devel-tools/build_test_library.cmake | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
static-analyser: | |
name: Clang 14 Static Analyser | |
runs-on: ubuntu-latest | |
needs: basicchecks | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install build dependencies for library | |
run: | | |
sudo apt -y install tcl8.6-dev clang-14 clang-tools-14 | |
- name: Checkout OpenMM (for Lepton library) | |
uses: actions/checkout@v3 | |
with: | |
repository: 'openmm/openmm' | |
ref: 'master' | |
path: 'openmm-source' | |
- name: Perform Clang Static Analyser | |
env: | |
CXX: clang++-14 | |
CC: clang-14 | |
run: | | |
scan-build-14 --use-cc=clang-14 --use-c++=clang++-14 cmake -P devel-tools/build_test_library.cmake 2>&1 | tee build_analyser.log | |
grep "CMake Error" build_analyser.log > build_errors.log || true | |
if [ -s build_errors.log ] ; then | |
echo "Found compiler errors during build" | |
cat build_analyser.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_analyser.log | tee warnings_analyser.log || true | |
if [ -s warnings_analyser.log ] ; then | |
echo "Found compiler warning during build" | |
exit 1 | |
fi | |
- name: Archive warnings artifacts | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: warnings_clang_static_analyser | |
path: warnings_analyser.log | |
build-linux-x86_64-many: | |
name: Linux x86_64 (GCC, Clang) | |
runs-on: ubuntu-latest | |
needs: basicchecks | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
env: | |
CCACHE: ccache | |
CMAKE_GENERATOR: Ninja | |
CCACHE_DIR: ${{ github.workspace }}/ccache | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Load compiler ccache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/ccache | |
key: ${{ runner.os }}-build-multiple-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-build-multiple- | |
- name: Get small downloadable packages | |
uses: actions/checkout@v3 | |
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 CentOS7-devel.sif oras://ghcr.io/Colvars/devel-containers:CentOS7-devel | |
apptainer pull CentOS9-devel.sif oras://ghcr.io/Colvars/devel-containers:CentOS9-devel | |
- name: GCC 4.8, C++11 (CentOS 7) | |
env: | |
CXX_STANDARD: 11 | |
CXX: g++ | |
CXX_VERSION: 4.8 | |
CC: gcc | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
cmake3 -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- name: Clang 3.4, C++11 (CentOS 7) | |
env: | |
CXX_STANDARD: 11 | |
CXX: clang++ | |
CXX_VERSION: 11 | |
CC: clang | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
cmake3 -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- name: Clang 7, C++17 (CentOS 7) | |
env: | |
CXX_STANDARD: 17 | |
CXX: clang++ | |
CXX_VERSION: 7 | |
CC: clang | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
scl enable llvm-toolset-${CXX_VERSION} -- \ | |
cmake3 -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- name: GCC 8, C++17 (CentOS 7) | |
env: | |
CXX_STANDARD: 17 | |
CXX: g++ | |
CXX_VERSION: 8 | |
CC: gcc | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
scl enable devtoolset-${CXX_VERSION} -- \ | |
cmake3 -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- name: GCC 9, C++14 (CentOS 7) | |
env: | |
CXX_STANDARD: 14 | |
CXX: g++ | |
CXX_VERSION: 9 | |
CC: gcc | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
scl enable devtoolset-${CXX_VERSION} -- \ | |
cmake3 -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- name: GCC 10, C++17 (CentOS 7) | |
env: | |
CXX_STANDARD: 17 | |
CXX: g++ | |
CXX_VERSION: 10 | |
CC: gcc | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
scl enable devtoolset-${CXX_VERSION} -- \ | |
cmake3 -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- 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++20 (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-12 -- \ | |
cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
- name: Clang 16, C++11 (CentOS 9) | |
env: | |
CXX_STANDARD: 11 | |
CXX: clang++ | |
CXX_VERSION: 16 | |
CC: clang | |
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 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.sif \ | |
cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake | |
build-linux-x86_64-sun: | |
name: Linux x86_64 (Sun compiler) | |
runs-on: ubuntu-latest | |
needs: basicchecks | |
if: needs.basicchecks.outputs.hassecrets == 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout Sun compiler (Oracle Developer Studio) | |
uses: actions/checkout@v3 | |
with: | |
repository: 'Colvars/oracle' | |
ssh-key: ${{ secrets.PULL_ORACLE_DEVELOPER_STUDIO }} | |
ref: 'master' | |
path: ${{github.workspace}}/oracle | |
- name: Get small downloadable packages | |
uses: actions/checkout@v3 | |
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 CentOS7-devel.sif oras://ghcr.io/Colvars/devel-containers:CentOS7-devel | |
- name: Build library with Sun compiler (Oracle Developer Studio) | |
shell: bash | |
env: | |
CC: ${{github.workspace}}/oracle/developerstudio12.6/bin/cc | |
CXX: ${{github.workspace}}/oracle/developerstudio12.6/bin/CC | |
run: | | |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \ | |
cmake3 -D CMAKE_CXX_STANDARD=11 -P devel-tools/build_test_library.cmake | |
build-windows-x86_64-msvc: | |
name: Windows x86_64 (MSVC) | |
runs-on: windows-latest | |
needs: basicchecks | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get small downloadable packages | |
uses: actions/checkout@v3 | |
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-x86_64-clang: | |
name: macOS x86_64 (AppleClang) | |
runs-on: macos-latest | |
needs: basicchecks | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get small downloadable packages | |
uses: actions/checkout@v3 | |
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 |