Skip to content

Commit

Permalink
[mod] renew documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
NaokiHori committed Jun 17, 2024
1 parent dc9bc61 commit fbcf4f3
Show file tree
Hide file tree
Showing 284 changed files with 11,248 additions and 21,908 deletions.
130 changes: 25 additions & 105 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@main
with:
repository: "NaokiHori/SimpleNSSolver"
ref: ${{ matrix.dimension }}d
submodules: "recursive"
- name: Install dependencies
Expand All @@ -39,7 +38,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: typical-cases-${{ matrix.dimension }}d
name: typical-${{ matrix.dimension }}d
path: artifacts

check-energy-conservations:
Expand All @@ -53,7 +52,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@main
with:
repository: "NaokiHori/SimpleNSSolver"
ref: ${{ matrix.dimension }}d
submodules: "recursive"
- name: Install dependencies
Expand All @@ -70,7 +68,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: check-energy-conservations-${{ matrix.dimension }}d
name: energy-${{ matrix.dimension }}d
path: artifacts

check-nusselt-agreements:
Expand All @@ -85,7 +83,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@main
with:
repository: "NaokiHori/SimpleNSSolver"
ref: ${{ matrix.dimension }}d
submodules: "recursive"
- name: Install dependencies
Expand All @@ -98,117 +95,40 @@ jobs:
pip install numpy matplotlib
- name: Pre-process, execute, and post-process
run: |
bash docs/source/examples/nu/data/exec_${{ matrix.dimension }}d.sh ${{ matrix.prandtl }}
bash docs/source/examples/nusselt/data/exec_${{ matrix.dimension }}d.sh ${{ matrix.prandtl }}
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: check-nusselt-agreements-${{ matrix.prandtl }}-${{ matrix.dimension }}d
name: nusselt-${{ matrix.dimension }}d-${{ matrix.prandtl }}
path: artifacts

check-gl-exec:
name: Check GL theory, execution
if: ${{ github.event.workflow_run.conclusion == 'success' }}
unify-and-push-artifacts:
name: Gather artifacts and push them to a branch
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
rayleigh: ["1.0e+4", "3.1e+4", "1.0e+5", "3.1e+5", "1.0e+6", "3.1e+6", "1.0e+7", "3.1e+7", "1.0e+8"]
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
with:
repository: "NaokiHori/SimpleNSSolver"
ref: "2d"
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-processing
run: |
python -m pip install --upgrade pip
pip install numpy
- name: Pre-process, execute, and post-process
run: |
bash docs/source/examples/gl/data/exec.sh ${{ matrix.rayleigh }}
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: gl-${{ matrix.rayleigh }}
path: artifacts

check-gl-post:
name: Check GL theory, post-process
runs-on: ubuntu-latest
needs: check-gl-exec
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
repository: "NaokiHori/SimpleNSSolver"
ref: "2d"
submodules: "recursive"
- name: Install python dependencies for post-processings
run: |
python -m pip install --upgrade pip
pip install numpy matplotlib
- name: Prepare place for dat files
run: |
mkdir data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-1.0e+4
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-3.1e+4
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-1.0e+5
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-3.1e+5
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-1.0e+6
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-3.1e+6
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-1.0e+7
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-3.1e+7
path: data
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: gl-1.0e+8
path: data
- name: Create figure from data
path: ${{ env.DIRECTORY_NAME }}
- name: Check artifacts
run: |
mkdir artifacts
python \
docs/source/examples/gl/data/process.py \
data \
artifacts/nu_ra.png
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: gl
path: artifacts
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 }}
76 changes: 16 additions & 60 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,15 @@ name: Documentation
on:

workflow_run:
workflows: [CI]
workflows: [ExtractND]
types:
- completed
workflow_dispatch:

jobs:

build-doc:
name: Build documentation
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
repository: "NaokiHori/SimpleNSSolver"
ref: "main"
- name: Install python dependencies for post-processings
run: |
python -m pip install --upgrade pip
pip install requests numpy matplotlib
- name: Download artifacts
run: |
python \
.github/workflows/documentation_download_artifact.py \
${{ secrets.GITHUB_TOKEN }}
- name: Draw figures
run: |
for fname in $(find docs/source -type f -name "draw_figure_*.py"); do
python ${fname};
done
- name: Check dead links
run: |
docker run \
--rm \
--volume ${PWD}:/project \
--workdir /project \
sphinxdoc/sphinx:latest \
sphinx-build -b linkcheck docs/source .
log=output.txt
if [ -e ${log} ]; then
wc -l ${log}
cat ${log}
fi
- name: Build documentation using Sphinx
run: |
docker run \
--rm \
--volume ${PWD}:/project \
--workdir /project \
sphinxdoc/sphinx:latest \
sphinx-build -b html docs/source docs/build
- name: Upload HTML artifacts
uses: actions/upload-artifact@main
with:
name: DocHTML
path: docs/build

deploy-doc:
name: Deploy documentation
build-and-deploy-doc:
name: Build and deploy documentation
permissions:
contents: read
pages: write
Expand All @@ -73,19 +23,25 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build-doc]
steps:
- name: Download HTML artifacts
uses: actions/download-artifact@main
- name: Checkout repository
uses: actions/checkout@main
with:
name: DocHTML
path: artifacts
ref: ${{ github.ref_name }}
- name: Build documentation using Sphinx
run: |
docker run \
--rm \
--volume ${PWD}:/project \
--workdir /project \
sphinxdoc/sphinx:latest \
sphinx-build docs/source docs/build
- name: Setup GitHub Pages
uses: actions/configure-pages@main
- name: Upload HTML
uses: actions/upload-pages-artifact@main
with:
path: artifacts
path: docs/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main
Expand Down
Loading

0 comments on commit fbcf4f3

Please sign in to comment.