-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from yoctoyotta1024/pathfix
refactor: improve Python examples with pathlib and improve CI build order
- Loading branch information
Showing
74 changed files
with
721 additions
and
618 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,133 @@ | ||
name: Build | ||
name: build | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
cmake libnetcdff-dev liblapack-dev python3-dev \ | ||
python3-numpy python3-mpi4py python3-pip curl \ | ||
libfyaml-dev libopenmpi-dev openmpi-bin | ||
- name: Build YAXT | ||
run: | | ||
curl -s -L https://swprojects.dkrz.de/redmine/attachments/download/534/yaxt-0.11.1.tar.gz | tar xvz | ||
cd yaxt-0.11.1 | ||
./configure --without-regard-for-quality --without-example-programs --without-perf-programs --with-pic \ | ||
--prefix=$HOME/yaxt | ||
make -j 4 | ||
make install | ||
- name: Build YAC | ||
run: | | ||
curl -s -L https://gitlab.dkrz.de/dkrz-sw/yac/-/archive/v3.2.0/yac-v3.2.0.tar.gz | tar xvz | ||
cd yac-v3.2.0 | ||
./configure CFLAGS="-fPIC" CC=mpicc FC=mpif90 --disable-mpi-checks --with-yaxt-root=${HOME}/yaxt \ | ||
--prefix=$HOME/yac | ||
make -j 4 | ||
make install | ||
- name: Build main | ||
run: | | ||
mkdir build && cd build | ||
cmake \ | ||
-DCMAKE_C_COMPILER=gcc \ | ||
-DCMAKE_CXX_COMPILER=g++ \ | ||
-DCMAKE_CXX_FLAGS="-Werror -Wall -pedantic -O3" \ | ||
-DKokkos_ENABLE_SERIAL=ON \ | ||
-DENABLE_YAC_COUPLING=ON \ | ||
-DYAXT_ROOT=${HOME}/yaxt \ | ||
-DYAC_ROOT=${HOME}/yac \ | ||
-DCMAKE_MODULE_PATH=${PWD}/../libs/coupldyn_yac/cmake .. | ||
make | ||
- name: Build example adia0d | ||
run: cd build && make adia0d | ||
|
||
- name: Build example golcolls | ||
run: cd build && make golcolls | ||
|
||
- name: Build example longcolls | ||
run: cd build && make longcolls | ||
|
||
- name: Build example lowlistcolls | ||
run: cd build && make lowlistcolls | ||
|
||
- name: Build example szakallurbichcolls | ||
run: cd build && make szakallurbichcolls | ||
|
||
- name: Build example testikstraubcolls | ||
run: cd build && make testikstraubcolls | ||
|
||
- name: Build example const2d | ||
run: cd build && make const2d | ||
|
||
- name: Build example divfree2d | ||
run: cd build && make divfree2d | ||
|
||
- name: Build example eurec4a1d | ||
run: cd build && make eurec4a1d | ||
|
||
- name: Build example rshaft1d | ||
run: cd build && make rshaft1d | ||
|
||
- name: Build example spdtest | ||
run: cd build && make spdtest | ||
|
||
- name: Build example bubble3d | ||
run: cd build && make bubble3d | ||
|
||
- name: Build example fromfile | ||
run: cd build && make fromfile | ||
|
||
- name: Build example fromfile_irreg | ||
run: cd build && make fromfile_irreg | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache YAXT | ||
id: cache_yaxt | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ runner.temp }}/yaxt/ | ||
key: ${{ runner.os }}-yaxt-cache-v0.11.1 | ||
restore-keys: | | ||
${{ runner.os }}-yaxt- | ||
- name: Cache YAC | ||
id: cache_yac | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ runner.temp }}/yac/ | ||
key: ${{ runner.os }}-yac-cache-v3.2.0 | ||
restore-keys: | | ||
${{ runner.os }}-yac- | ||
- name: Setup | ||
if: steps.cache_yaxt.outputs.cache-hit != 'true' || steps.cache_yac.outputs.cache-hit != 'true' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
cmake libnetcdff-dev liblapack-dev python3-dev \ | ||
python3-numpy python3-mpi4py python3-pip curl \ | ||
libfyaml-dev libopenmpi-dev openmpi-bin | ||
- name: Build YAXT | ||
if: steps.cache_yaxt.outputs.cache-hit != 'true' | ||
run: | | ||
curl -s -L https://swprojects.dkrz.de/redmine/attachments/download/534/yaxt-0.11.1.tar.gz | tar xvz | ||
cd yaxt-0.11.1 | ||
./configure --without-regard-for-quality --without-example-programs \ | ||
--without-perf-programs --with-pic --prefix=${{ runner.temp }}/yaxt | ||
make -j 4 | ||
make install | ||
- name: Build YAC | ||
if: steps.cache_yac.outputs.cache-hit != 'true' | ||
run: | | ||
curl -s -L https://gitlab.dkrz.de/dkrz-sw/yac/-/archive/v3.2.0/yac-v3.2.0.tar.gz | tar xvz | ||
cd yac-v3.2.0 | ||
./configure CFLAGS="-fPIC" CC=mpicc FC=mpif90 --disable-mpi-checks \ | ||
--with-yaxt-root=${{ runner.temp }}/yaxt --prefix=${{ runner.temp }}/yac | ||
make -j 4 | ||
make install | ||
build_basic_examples: | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
strategy: | ||
matrix: | ||
target: [all, adia0d, golcolls, longcolls, lowlistcolls, szakallurbichcolls, | ||
testikstraubcolls, const2d, divfree2d, eurec4a1d, rshaft1d, spdtest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
cmake libopenmpi-dev openmpi-bin | ||
- name: Build Example | ||
run: | | ||
mkdir build | ||
cmake -S ./ -B ./build \ | ||
-DCMAKE_C_COMPILER=gcc \ | ||
-DCMAKE_CXX_COMPILER=g++ \ | ||
-DCMAKE_CXX_FLAGS="-Werror -Wall -pedantic -O3" \ | ||
-DKokkos_ENABLE_SERIAL=ON \ | ||
-DENABLE_YAC_COUPLING=OFF | ||
- name: Compile Example | ||
run: cd build && make ${{ matrix.target }} | ||
|
||
build_yac_examples: | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
strategy: | ||
matrix: | ||
target: [all, bubble3d, fromfile, fromfile_irreg] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
cmake libnetcdff-dev liblapack-dev python3-dev \ | ||
python3-numpy python3-mpi4py python3-pip curl \ | ||
libfyaml-dev libopenmpi-dev openmpi-bin | ||
- name: Restore YAXT Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ runner.temp }}/yaxt/ | ||
key: ${{ runner.os }}-yaxt-cache-v0.11.1 | ||
|
||
- name: Restore YAC Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ runner.temp }}/yac/ | ||
key: ${{ runner.os }}-yac-cache-v3.2.0 | ||
|
||
- name: Build YAC Example | ||
run: | | ||
mkdir build | ||
cmake -S ./ -B ./build \ | ||
-DCMAKE_C_COMPILER=gcc \ | ||
-DCMAKE_CXX_COMPILER=g++ \ | ||
-DCMAKE_CXX_FLAGS="-Werror -Wall -pedantic -O3" \ | ||
-DKokkos_ENABLE_SERIAL=ON \ | ||
-DENABLE_YAC_COUPLING=ON \ | ||
-DYAXT_ROOT=${{ runner.temp }}/yaxt \ | ||
-DYAC_ROOT=${{ runner.temp }}/yac \ | ||
-DCMAKE_MODULE_PATH=${PWD}/libs/coupldyn_yac/cmake | ||
- name: Compile YAC Example | ||
run: cd build && make ${{ matrix.target }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Python setup | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Pre-commit run | ||
uses: pre-commit/[email protected].0 | ||
uses: pre-commit/[email protected].1 |
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
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
Oops, something went wrong.