Skip to content

Commit

Permalink
refactor: seperate steps in build CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctoyotta1024 committed Oct 30, 2024
1 parent 49959bd commit dc0713c
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 91 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python test
name: CI (pytest and documentation)

on: [push, pull_request]

Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
cd docs && make html
- name: Archive build artifacts (i.e. documentation)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/build/html/
Expand All @@ -58,7 +58,7 @@ jobs:
name: html-docs
path: docs/build/html/
- name: Publish docs on GitHub pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
236 changes: 151 additions & 85 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,158 @@
name: Build
name: build

on: pull_request

jobs:
build:
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: 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=${{ runner.temp }}/yaxt
make -j 4
make install
- name: Upload YAXT
uses: actions/upload-artifact@v4
with:
name: yaxt-artifact
path: ${{ runner.temp }}/yaxt/

- 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=${{ runner.temp }}/yaxt --prefix=${{ runner.temp }}/yac
make -j 4
make install
- name: Upload YAC
uses: actions/upload-artifact@v4
with:
name: yac-artifact
path: ${{ runner.temp }}/yac/

- name: Build main
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: Upload CLEO Build
uses: actions/upload-artifact@v4
with:
name: cleo-build-artifact
path: ./build/

compile:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download CLEO Build
uses: actions/download-artifact@v4
with:
name: cleo-build-artifact
path: ./build/

- name: Download YAXT
uses: actions/download-artifact@v4
with:
name: yaxt-artifact
path: ${{ runner.temp }}/yaxt/

- name: Download YAC
uses: actions/download-artifact@v4
with:
name: yac-artifact
path: ${{ runner.temp }}/yac/

- name: Build main
run: cd build && make

compile_adia0d:
runs-on: ubuntu-latest
needs: [build, compile]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download CLEO Build
uses: actions/download-artifact@v4
with:
name: cleo-build-artifact
path: ./build/

- name: Build adia0d
run: cd build && make adia0d

compile_examples:
runs-on: ubuntu-latest
needs: [build, compile]
steps:
- name: Checkout
uses: actions/checkout@v4

- 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
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/action@v3.0.0
uses: pre-commit/action@v3.0.1
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ repos:
rev: 0.8.0
hooks:
- id: cpplint
args: [--linelength=100, "--filter=-runtime/references,-readability/braces,-build/include,-build/c++17"]
args:
- --linelength=100
- --filter=-runtime/references,-readability/braces,-whitespace/indent_namespace,
-build/include,-build/c++11,-build/c++17
types_or: [c, c++, cuda]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
Expand Down

0 comments on commit dc0713c

Please sign in to comment.