CI #459
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
name: CI | |
on: | |
workflow_run: | |
workflows: [ExtractND] | |
types: | |
- completed | |
jobs: | |
run-typical-cases: | |
name: Run typical 2D and 3D cases | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dimension: [2, 3] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
ref: ${{ matrix.dimension }}d | |
submodules: "recursive" | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev libfftw3-dev | |
- name: Setup headless display | |
uses: pyvista/setup-headless-display-action@main | |
- name: Install python dependencies for pre- and post-processings | |
run: | | |
python -m pip install --upgrade pip | |
pip install numpy matplotlib pyvista | |
- name: Pre-process, execute, and post-process | |
run: | | |
bash docs/source/examples/typical/data/exec_${{ matrix.dimension }}d.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@main | |
with: | |
name: typical-${{ matrix.dimension }}d | |
path: artifacts | |
check-energy-conservations: | |
name: Check discrete energy conservations | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dimension: [2, 3] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
ref: ${{ matrix.dimension }}d | |
submodules: "recursive" | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev libfftw3-dev | |
- name: Install python dependencies for pre- and post-processings | |
run: | | |
python -m pip install --upgrade pip | |
pip install numpy matplotlib | |
- name: Pre-process, execute, and post-process | |
run: | | |
bash docs/source/examples/energy/data/exec_${{ matrix.dimension }}d.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@main | |
with: | |
name: energy-${{ matrix.dimension }}d | |
path: artifacts | |
check-nusselt-agreements: | |
name: Check Nusselt number agreements | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dimension: [2, 3] | |
prandtl: ["1.e-1", "1.e+0", "1.e+1"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
ref: ${{ matrix.dimension }}d | |
submodules: "recursive" | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev libfftw3-dev | |
- name: Install python dependencies for pre- and post-processings | |
run: | | |
python -m pip install --upgrade pip | |
pip install numpy matplotlib | |
- name: Pre-process, execute, and post-process | |
run: | | |
bash docs/source/examples/nusselt/data/exec_${{ matrix.dimension }}d.sh ${{ matrix.prandtl }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@main | |
with: | |
name: nusselt-${{ matrix.dimension }}d-${{ matrix.prandtl }} | |
path: artifacts | |
unify-and-push-artifacts: | |
name: Gather artifacts and push them to a branch | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
needs: [run-typical-cases, check-energy-conservations, check-nusselt-agreements] | |
env: | |
BRANCH_NAME: artifacts | |
DIRECTORY_NAME: artifacts | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
- name: Download artifacts | |
uses: actions/download-artifact@main | |
with: | |
path: ${{ env.DIRECTORY_NAME }} | |
- name: Check artifacts | |
run: | | |
ls -R ${{ env.DIRECTORY_NAME }} | |
- name: Push artifacts | |
run: | | |
set -x | |
set -e | |
git config --local user.email "36466440+NaokiHori@users.noreply.github.com" | |
git config --local user.name "NaokiHori" | |
git switch -c ${{ env.BRANCH_NAME }} | |
git add ${{ env.DIRECTORY_NAME }} | |
git commit -m "Update artifacts" -a || true | |
git push -f origin ${{ env.BRANCH_NAME }} | |