From 91906049ad95fc10e0c7097a28ea76edf890a08f Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 15:41:50 +0200 Subject: [PATCH 01/10] feat: adds a workflow for testing advection example --- .github/workflows/test_t8code_advection.yml | 76 +++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/test_t8code_advection.yml diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml new file mode 100644 index 0000000000..9c94ea4a6b --- /dev/null +++ b/.github/workflows/test_t8code_advection.yml @@ -0,0 +1,76 @@ +name: test t8code examples + + +# This file is part of t8code. +# t8code is a C library to manage a collection (a forest) of multiple +# connected adaptive space-trees of general element types in parallel. +# +# Copyright (C) 2026 the developers +# +# t8code is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# t8code is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with t8code; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +name: Test t8code Compilation + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + compiler: [gcc, clang] + # Test various compiler flags and debug levels + flags: + - "-O2" + - "-O3 -Wall -Wextra" + - "-DT8_ENABLE_DEBUG=1" + - "-O2 -DT8_ENABLE_DEBUG=0" + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install System Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + build-essential \ + gfortran \ + libopenmpi-dev \ + openmpi-bin \ + clang + + - name: Configure CMake + run: | + if [ "${{ matrix.compiler }}" = "gcc" ]; then + export CC=gcc CXX=g++ + else + export CC=clang CXX=clang++ + fi + + cmake -B build -S . \ + -DCMAKE_BUILD_TYPE=Release \ + -DEXTRA_FLAGS="${{ matrix.flags }}" + + - name: Compile Executable + run: | + cmake --build build --target t8_advection -j $(nproc) \ No newline at end of file From 38b72b7effbc6f352c138c4ea75513262ce1c310 Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 15:45:32 +0200 Subject: [PATCH 02/10] fix: make name more specific --- .github/workflows/test_t8code_advection.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index 9c94ea4a6b..5b9be1316e 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -1,4 +1,4 @@ -name: test t8code examples +name: test t8code advection examples # This file is part of t8code. From cdfa61216cc68214cda3ab1fb682a7d4657e79ab Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 15:46:51 +0200 Subject: [PATCH 03/10] fix: remove second name --- .github/workflows/test_t8code_advection.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index 5b9be1316e..6bd4a45581 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -20,7 +20,6 @@ name: test t8code advection examples # You should have received a copy of the GNU General Public License # along with t8code; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -name: Test t8code Compilation on: push: From a98285c1324d48c33dbe45d9a9bbfbf498b1335f Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:00:46 +0200 Subject: [PATCH 04/10] fix: rewrite configure cmake --- .github/workflows/test_t8code_advection.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index 6bd4a45581..5c5347b37a 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -60,16 +60,18 @@ jobs: - name: Configure CMake run: | + # Set compiler variables based on matrix selection if [ "${{ matrix.compiler }}" = "gcc" ]; then - export CC=gcc CXX=g++ + C_COMP="gcc" + CXX_COMP="g++" else - export CC=clang CXX=clang++ + C_COMP="clang" + CXX_COMP="clang++" fi cmake -B build -S . \ + -DCMAKE_C_COMPILER=$C_COMP \ + -DCMAKE_CXX_COMPILER=$CXX_COMP \ -DCMAKE_BUILD_TYPE=Release \ - -DEXTRA_FLAGS="${{ matrix.flags }}" - - - name: Compile Executable - run: | - cmake --build build --target t8_advection -j $(nproc) \ No newline at end of file + -DCMAKE_C_FLAGS="${{ matrix.flags }}" \ + -DCMAKE_CXX_FLAGS="${{ matrix.flags }}") \ No newline at end of file From a42b493b878472a8421a799f15ca88da83141b57 Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:06:13 +0200 Subject: [PATCH 05/10] fix: adds back the executable --- .github/workflows/test_t8code_advection.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index 5c5347b37a..c6ddfaa4ce 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -74,4 +74,9 @@ jobs: -DCMAKE_CXX_COMPILER=$CXX_COMP \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS="${{ matrix.flags }}" \ - -DCMAKE_CXX_FLAGS="${{ matrix.flags }}") \ No newline at end of file + -DCMAKE_CXX_FLAGS="${{ matrix.flags }}") + + - name: Compile Executable + run: | + NPROC=$(nproc) + cmake --build build --target t8_advection -j $NPROC \ No newline at end of file From 57285008a86be8b6447c7210f00f35f02a386fe3 Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:10:41 +0200 Subject: [PATCH 06/10] fix: removes nproc and exchanges it with parallel --- .github/workflows/test_t8code_advection.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index c6ddfaa4ce..caed22da88 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -76,7 +76,5 @@ jobs: -DCMAKE_C_FLAGS="${{ matrix.flags }}" \ -DCMAKE_CXX_FLAGS="${{ matrix.flags }}") - - name: Compile Executable - run: | - NPROC=$(nproc) - cmake --build build --target t8_advection -j $NPROC \ No newline at end of file + - name: Compile Executable + run: cmake --build build --target t8_advection --parallel \ No newline at end of file From 98cc07dbc09fdef2d17cd0148cf988ac62693cbf Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:14:47 +0200 Subject: [PATCH 07/10] lint: adds 1 space --- .github/workflows/test_t8code_advection.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index caed22da88..2287476ce4 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -76,5 +76,5 @@ jobs: -DCMAKE_C_FLAGS="${{ matrix.flags }}" \ -DCMAKE_CXX_FLAGS="${{ matrix.flags }}") - - name: Compile Executable + - name: Compile Executable run: cmake --build build --target t8_advection --parallel \ No newline at end of file From 8435ca3533291b96d4e7da1a30fb51ee85963d80 Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:17:49 +0200 Subject: [PATCH 08/10] fix: removes trailing ) --- .github/workflows/test_t8code_advection.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index 2287476ce4..bba4fc3406 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -74,7 +74,7 @@ jobs: -DCMAKE_CXX_COMPILER=$CXX_COMP \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS="${{ matrix.flags }}" \ - -DCMAKE_CXX_FLAGS="${{ matrix.flags }}") + -DCMAKE_CXX_FLAGS="${{ matrix.flags }}" - name: Compile Executable run: cmake --build build --target t8_advection --parallel \ No newline at end of file From cd66ae9bcd3affccc3b8c5e623ed77b355b00642 Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:20:56 +0200 Subject: [PATCH 09/10] fix: set a fetch depth --- .github/workflows/test_t8code_advection.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index bba4fc3406..29e1004656 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -46,6 +46,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install System Dependencies run: | From 9bf377f9bbf10ba16490331bb95bd8004554c003 Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Fri, 21 Aug 2026 16:40:50 +0200 Subject: [PATCH 10/10] chore: replace gcc with mpi --- .github/workflows/test_t8code_advection.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml index 29e1004656..d2c939e754 100644 --- a/.github/workflows/test_t8code_advection.yml +++ b/.github/workflows/test_t8code_advection.yml @@ -64,8 +64,8 @@ jobs: run: | # Set compiler variables based on matrix selection if [ "${{ matrix.compiler }}" = "gcc" ]; then - C_COMP="gcc" - CXX_COMP="g++" + C_COMP="mpicc" + CXX_COMP="mpicxx" else C_COMP="clang" CXX_COMP="clang++"