Skip to content

Commit

Permalink
Merge branch 'next' into options-array-ints-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwoerer committed Oct 18, 2023
2 parents 1c1d834 + bd75280 commit 0156c0e
Show file tree
Hide file tree
Showing 186 changed files with 562 additions and 23,196 deletions.
7 changes: 4 additions & 3 deletions .build_petsc_for_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
set -e

if test $BUILD_PETSC ; then
if [[ ! -d $HOME/local/petsc/include/petsc ]]; then
if [[ ! -d $HOME/local/petsc/include/petsc ]] || test $1 ; then
echo "****************************************"
echo "Building PETSc"
echo "****************************************"

git clone -b release https://gitlab.com/petsc/petsc.git petsc --depth=1
branch=${1:-release}
git clone -b $branch https://gitlab.com/petsc/petsc.git petsc --depth=1

unset PETSC_DIR
unset PETSC_ARCH
Expand All @@ -34,7 +35,7 @@ if test $BUILD_PETSC ; then
echo "Building SLEPc"
echo "****************************************"

git clone -b release https://gitlab.com/slepc/slepc.git slepc --depth=1
git clone -b $branch https://gitlab.com/slepc/slepc.git slepc --depth=1

pushd slepc
unset SLEPC_DIR
Expand Down
24 changes: 16 additions & 8 deletions .ci_fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ then
# 3. docker start -a mobydick <=> start to run the container (initialized with docker-cp)
if test $1 = podman ; then
cmd=podman
# For the use of testing
git submodule update --init # --recursive
else
cmd="sudo docker"
fi
test . != ".$2" && mpi="$2" || mpi=openmpi
test . != ".$3" && version="$3" || version=latest
test . != ".$3" && version="$3" || version=rawhide
time $cmd pull registry.fedoraproject.org/fedora:$version
time $cmd create --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--shm-size 256M \
--name mobydick registry.fedoraproject.org/fedora:$version \
/tmp/BOUT-dev/.ci_fedora.sh $mpi
time $cmd cp ${TRAVIS_BUILD_DIR} mobydick:/tmp
time $cmd cp ${TRAVIS_BUILD_DIR:-$(pwd)} mobydick:/tmp/BOUT-dev
time $cmd start -a mobydick
exit 0
fi
Expand All @@ -37,19 +40,19 @@ then
cat /etc/os-release
# Ignore weak depencies
echo "install_weak_deps=False" >> /etc/dnf/dnf.conf
time dnf -y install dnf5-plugins python3-pip cmake
time dnf -y install dnf5
time dnf5 -y install dnf5-plugins cmake python3-zoidberg python3-natsort
# Allow to override packages - see #2073
time dnf copr enable -y davidsch/fixes4bout || :
time dnf -y upgrade
time dnf -y builddep bout++
time dnf5 copr enable -y davidsch/fixes4bout || :
time dnf5 -y upgrade
time dnf5 -y builddep bout++
useradd test
cp -a /tmp/BOUT-dev /home/test/
chown -R test /home/test
chmod u+rwX /home/test -R
sudo -u test ${0/\/tmp/\/home\/test} $mpi
## If we are called as normal user, run test
else
pip install --user zoidberg natsort
. /etc/profile.d/modules.sh
module load mpi/${1}-x86_64
export OMPI_MCA_rmaps_base_oversubscribe=yes
Expand All @@ -58,7 +61,12 @@ else
cd
cd BOUT-dev
echo "starting configure"
time cmake -S . -B build -DBOUT_USE_PETSC=ON
time cmake -S . -B build -DBOUT_USE_PETSC=ON \
-DBOUT_UPDATE_GIT_SUBMODULE=OFF \
-DBOUT_USE_SYSTEM_FMT=ON \
-DBOUT_USE_SYSTEM_MPARK_VARIANT=ON \
-DBOUT_USE_SUNDIALS=ON

time make -C build build-check -j 2
time make -C build check
fi
6 changes: 6 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -359,5 +359,11 @@ CheckOptions:
value: 'false'
- key: readability-simplify-subscript-expr.Types
value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array'
- key: readability-identifier-length.IgnoredVariableNames
value: '^n?[xyz]$'
- key: readability-identifier-length.IgnoredParameterNames
value: '^[ijkxyz][01]?$'
- key: readability-identifier-length.IgnoredLoopCounterNames
value: '^[ijkxyz_]$'
...

4 changes: 2 additions & 2 deletions .github/workflows/black-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

Expand All @@ -41,6 +41,6 @@ jobs:
ls
$HOME/.local/bin/black tests/ tools/ $(grep -EIlr '^#!.*python.*$' bin/ tests/ tools/ src/ | grep -v _boutpp_build)
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply black changes"
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the pull request branch, also include all history
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
Expand All @@ -25,6 +25,6 @@ jobs:
run: git clang-format origin/${{ github.base_ref }}

- name: Commit to the PR branch
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply clang-format changes"
6 changes: 3 additions & 3 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Run clang-tidy
uses: ZedThree/clang-tidy-review@v0.13.1
uses: ZedThree/clang-tidy-review@v0.14.0
id: review
with:
build_dir: build
Expand All @@ -46,4 +46,4 @@ jobs:
-DBOUT_UPDATE_GIT_SUBMODULE=OFF
- name: Upload clang-tidy fixes
uses: ZedThree/clang-tidy-review/upload@v0.13.1
uses: ZedThree/clang-tidy-review/upload@v0.14.0
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@master
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@master
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
prefix=${{ matrix.mpi }}-${{matrix.metric3d.tag_prefix}}${{ matrix.config.tag_postfix }}-
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@master
with:
build-args: |
BASE=${{ matrix.mpi }}-${{ matrix.metric3d.base_prefix }}${{ matrix.config.base_postfix }}-main
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- name: Install dependencies
run: python -m pip install --upgrade pip &&
pip install --upgrade build &&
Expand Down Expand Up @@ -57,12 +57,12 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- name: Install dependencies
run: python -m pip install --upgrade pip &&
pip install --upgrade build &&
Expand Down Expand Up @@ -106,12 +106,12 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- name: Install dependencies
run: python -m pip install --upgrade pip &&
pip install --upgrade build &&
Expand Down
50 changes: 43 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Tests
on: [push, pull_request]
on:
push:
pull_request:
schedule:
# run sunday moring
- cron: '30 6 * * 0'

defaults:
run:
Expand Down Expand Up @@ -30,10 +35,29 @@ jobs:
# Need this to be able to exclude the coverage job
is_master_or_next:
- ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.base_ref == 'master' || github.base_ref == 'next' }}
is_cron:
- ${{ github.event_name == 'cron' }}
config:
- name: "CMake, PETSc unreleased"
os: ubuntu-20.04
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"
build_petsc: -petsc-main
build_petsc_branch: main
on_cron: true

- name: "Default options, Ubuntu 20.04"
os: ubuntu-20.04
cmake_options: ""
on_cron: false

- name: "Optimised, static"
os: ubuntu-20.04
Expand All @@ -47,6 +71,7 @@ jobs:
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false

- name: "Debug, shared"
os: ubuntu-20.04
Expand All @@ -58,6 +83,7 @@ jobs:
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false

- name: "Shared, release, Ubuntu 20.04"
os: ubuntu-20.04
Expand All @@ -70,6 +96,7 @@ jobs:
-DBOUT_BUILD_DOCS=OFF
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false

- name: "Shared, OpenMP, 3D metrics"
os: ubuntu-latest
Expand All @@ -82,6 +109,7 @@ jobs:
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false

- name: "CMake, new PETSc"
os: ubuntu-20.04
Expand All @@ -95,8 +123,8 @@ jobs:
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"

build_petsc: -petsc
on_cron: false

- name: "Coverage"
os: ubuntu-20.04
Expand All @@ -111,11 +139,15 @@ jobs:
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
unit_only: YES
on_cron: false
exclude:
# Don't run the coverage tests if the branch isn't master or next
- is_master_or_next: false
config:
name: "Coverage"
- is_cron: true
config:
on_cron: false

steps:
- name: Job information
Expand Down Expand Up @@ -143,18 +175,22 @@ jobs:
liblapack-dev
libparpack2-dev

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install pip packages
run: |
./.pip_install_for_ci.sh 'cython~=0.29' 'netcdf4~=1.5' 'sympy~=1.5' 'gcovr' 'cmake' zoidberg fastcov
# Add the pip install location to the runner's PATH
echo ~/.local/bin >> $GITHUB_PATH
- name: Cache SUNDIALS build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /home/runner/local
key: bout-sundials-${{ matrix.config.os }}${{ matrix.config.build_petsc }}
Expand All @@ -163,7 +199,7 @@ jobs:
run: ./.build_sundials_for_ci.sh

- name: Build PETSc
run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh
run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh ${{ matrix.config.build_petsc_branch }}

- name: Build BOUT++
run: UNIT_ONLY=${{ matrix.config.unit_only }} ./.ci_with_cmake.sh ${{ matrix.config.cmake_options }}
Expand All @@ -182,15 +218,15 @@ jobs:
- name: Upload coverage
if: ${{ matrix.config.name == 'Coverage' }}
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

Fedora:
# This is its own job as it doesn't use most of the steps of the
# standard_tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Build Fedora rawhide
Expand Down
4 changes: 3 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ sphinx:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: manual/sphinx/requirements.txt


build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- mpich
- libmpich-dev
Expand Down
Loading

0 comments on commit 0156c0e

Please sign in to comment.