Skip to content

Commit

Permalink
Merge pull request #281 from espressomd/python
Browse files Browse the repository at this point in the history
Merge Espresso head
  • Loading branch information
bogdan-tanygin committed Aug 29, 2023
2 parents 7444cc1 + f8e0a66 commit 6817e4c
Show file tree
Hide file tree
Showing 2,217 changed files with 201,659 additions and 132,149 deletions.
13 changes: 8 additions & 5 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ Checks: |
clang-diagnostic-*,
clang-analyzer-*,
-clang-analyzer-core.NullDereference,
-clang-analyzer-core.uninitialized.UndefReturn,
-clang-analyzer-optin.mpi.MPI-Checker,
-clang-analyzer-security.FloatLoopCounter,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
clang-analyzer-alpha.*,
modernize-avoid-c-arrays,
modernize-deprecated-headers,
modernize-make-shared,
modernize-make-unique,
Expand Down Expand Up @@ -36,7 +39,7 @@ Checks: |
readability-string-compare,
readability-uniqueptr-delete-release,
readability-function-size'
WarningsAsErrors: '*'
WarningsAsErrors: '*,-clang-analyzer-core.StackAddrEscapeBase,-clang-analyzer-optin.mpi.MPI-Checker'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
Expand Down Expand Up @@ -71,15 +74,15 @@ CheckOptions:
- key: modernize-make-shared.IgnoreMacros
value: '1'
- key: modernize-make-shared.IncludeStyle
value: '0'
value: 'llvm'
- key: modernize-make-shared.MakeSmartPtrFunction
value: 'std::make_shared'
- key: modernize-make-shared.MakeSmartPtrFunctionHeader
value: memory
- key: modernize-make-unique.IgnoreMacros
value: '1'
- key: modernize-make-unique.IncludeStyle
value: '0'
value: 'llvm'
- key: modernize-make-unique.MakeSmartPtrFunction
value: 'std::make_unique'
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
Expand Down
22 changes: 22 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):
# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
# statements.
first_comment_is_literal = True

# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):
# If an argument group contains more than this many sub-groups (parg or kwarg
# groups) then force it to a vertical layout.
max_subgroups_hwrap = 12
# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 12
# If a candidate layout is wrapped horizontally but it exceeds this many
# lines, then reject the layout.
max_lines_hwrap = 6
26 changes: 17 additions & 9 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ codecov:
branch: python
notify:
require_ci_to_pass: yes
ci:
- !travis-ci.org

coverage:
precision: 0
Expand All @@ -14,14 +12,21 @@ coverage:
status:
project:
default: false
tests:
integration_tests:
paths:
- src/core/unit_tests/
- testsuite/python/
enabled: yes
threshold: 1%
unit_tests:
paths:
- "src/**/*tests/"
enabled: yes
threshold: 1%
core:
paths:
- !src/core/unit_tests/
- "src/"
- "!src/**/*tests/"
- "!src/python/"
enabled: yes
threshold: 1%
patch:
Expand All @@ -38,10 +43,13 @@ parsers:
method: no
macro: no

comment:
layout: "reach, diff, flags, files, footer"
behavior: default
require_changes: no
comment: false

ignore:
- "libs"
- "doc/tutorials"
- "samples"
- "maintainer"
- "src/walberla_bridge/**/generated_kernels/*"
- "src/walberla_bridge/myintrin.h"
- "src/walberla_bridge/philox_rand.h"
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
parallel = True
9 changes: 9 additions & 0 deletions .cppcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// clang-format off
constParameter
unusedFunction
missingIncludeSystem
noConstructor
noExplicitConstructor
redundantAssignment
uselessAssignmentPtrArg
preprocessorErrorDirective
10 changes: 1 addition & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
Fixes #

Description of changes:
-


PR Checklist
------------
- [ ] Tests?
- [ ] Interface
- [ ] Core
- [ ] Docs?
-
19 changes: 19 additions & 0 deletions .github/actions/build_and_check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Build and check'
description: 'Build espresso and run checks'
runs:
using: "composite"
steps:
- run: |
brew install boost boost-mpi fftw
brew install hdf5-mpi
pip3 install -c requirements.txt numpy cython h5py scipy
shell: bash
if: runner.os == 'macOS'
- run: |
export myconfig=maxset with_cuda=false with_gsl=false test_timeout=800 check_skip_long=true
bash maintainer/CI/build_cmake.sh
shell: bash
# This is a workaround for the unfortunate interaction of MacOS and OpenMPI 4
# See https://github.com/open-mpi/ompi/issues/6518
env:
OMPI_MCA_btl: "self,tcp"
53 changes: 53 additions & 0 deletions .github/actions/deploy_docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Deploy documentation'
description: 'Deploy ESPResSo documentation'
runs:
using: "composite"
steps:
- run: |
# checkout github pages
cd "${HOME}"
git clone --quiet git@github.com:espressomd/espressomd.github.io.git
cd espressomd.github.io
# check if already up-to-date (i.e. the commit SHA of the
# generated docs is identical to the current commit SHA)
LAST_COMMIT=$(git log -1 --pretty=format:"%s" remotes/origin/main)
NEXT_COMMIT="Documentation for ${GITHUB_SHA}"
if [ "${NEXT_COMMIT}" = "${LAST_COMMIT}" ]; then
echo "Documentation already up-to-date.";
exit 0;
fi
# download artifacts
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=run_tutorials --fail -L -o tutorials.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=run_doxygen --fail -L -o doxygen.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=check_sphinx --fail -L -o sphinx.zip
if grep -F '<!DOCTYPE html>' *.zip; then
echo "The artifacts could not be downloaded.";
exit 1;
fi
unzip -q '*.zip'
# create a fresh main branch containing the docs of old releases
git config --global user.email "noreply@icp.uni-stuttgart.de"
git config --global user.name "espresso-ci"
git checkout -b new_main remotes/origin/releases
# generate the landing page by merging the branch containing the
# HTML theme and Markdown files, then convert them to HTML files
git merge --quiet --commit --no-edit --allow-unrelated-histories remotes/origin/landing_page
make tutorials.md
make videos.md
for filename in *.md; do
make "${filename%.md}.html";
done
rm *_header.html
git add *.html
git clean -f
git rm *.md *.py Makefile
git commit --quiet -m "Generate landing page"
# add devel documentation
rsync -a --delete --exclude='*.md5' --exclude='*.map' "build/doc/doxygen/html/" dox/
rsync -a --delete --exclude='.buildinfo' "build/doc/sphinx/html/" doc/
rsync -a --delete "build/doc/tutorials/html/" tutorials/
git add doc dox tutorials
git commit --quiet -m "${NEXT_COMMIT}"
# deploy
git push -f origin new_main:main
shell: bash
25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: deploy

on:
schedule:
- cron: '0 7 * * *'

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
deploy_docs:
runs-on: ubuntu-22.04
if: github.repository == 'espressomd/espresso'
environment: deploy_documentation
steps:
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_SSH_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@main
- name: Deploy documentation
uses: ./.github/actions/deploy_docs
110 changes: 110 additions & 0 deletions .github/workflows/push_pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: run tests

on:
push:
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
macos:
runs-on: macos-12
if: ${{ github.repository == 'espressomd/espresso' }}
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: macos
save: ${{ github.ref == 'refs/heads/python' }}
- name: Setup Python environment
uses: actions/setup-python@v4.3.1
with:
python-version: '3.9'
- name: Get runner specifications
run: system_profiler SPHardwareDataType
- name: Build and check
uses: ./.github/actions/build_and_check
env:
build_procs: 3
check_procs: 3
with_ccache: 'true'

debian:
runs-on: ubuntu-latest
container:
image: ghcr.io/espressomd/docker/debian:fbdf2f2f9d76b761c0aa1308f17fb17e38501850-base-layer
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
options: --cpus 2
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: debian
save: ${{ github.ref == 'refs/heads/python' || ( github.repository != 'espressomd/espresso' && ! startsWith(github.ref, 'refs/pull') ) }}
- name: Setup Git environment
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Get runner specifications
run: lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'
- name: Build and check
uses: ./.github/actions/build_and_check
env:
build_procs: 2
check_procs: 2
myconfig: 'maxset'
with_ccache: 'true'
with_cuda: 'false'
with_hdf5: 'true'
with_fftw: 'true'
with_gsl: 'false'
with_scafacos: 'false'
with_stokesian_dynamics: 'false'
make_check_unit_tests: 'true'
make_check_python: 'false'
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

ubuntu:
runs-on: ubuntu-latest
if: ${{ github.repository == 'espressomd/espresso' }}
container:
image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:fbdf2f2f9d76b761c0aa1308f17fb17e38501850-base-layer
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
options: --cpus 2
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ubuntu
save: ${{ github.ref == 'refs/heads/python' }}
- name: Setup Git environment
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Get runner specifications
run: lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'
- name: Build and check
uses: ./.github/actions/build_and_check
env:
build_procs: 2
check_procs: 2
myconfig: 'maxset'
with_ccache: 'true'
with_cuda: 'false'
with_hdf5: 'false'
with_fftw: 'false'
with_gsl: 'false'
with_scafacos: 'false'
with_stokesian_dynamics: 'false'
make_check_unit_tests: 'false'
make_check_python: 'false'
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
Loading

0 comments on commit 6817e4c

Please sign in to comment.