Skip to content

Commit

Permalink
Merge pull request #2765 from boutproject/petsc-main
Browse files Browse the repository at this point in the history
CI: Run on PETSc developement branch
  • Loading branch information
ZedThree authored Oct 18, 2023
2 parents 67022ee + 6c13412 commit 7a7f3c6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 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
38 changes: 35 additions & 3 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 @@ -163,7 +195,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 Down

0 comments on commit 7a7f3c6

Please sign in to comment.