This file contains hidden or 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: Run perpendicular-flap experiments | |
| on: | |
| push: | |
| branches: | |
| - use-github-actions-for-diss-cases | |
| jobs: | |
| run_experiments: | |
| strategy: | |
| matrix: | |
| experiment: | |
| - name: Figure 6.6 | |
| args: 'fig6_6_config.csv -o studies/fig6_6.csv' | |
| - name: Figure 6.7 | |
| args: 'fig6_7_config.csv -o studies/fig6_7.csv' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./perpendicular-flap | |
| container: benjaminrodenberg/fenics-openfoam | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Check user | |
| run: whoami | |
| - name: Install sudo | |
| run: | | |
| apt-get -qq update | |
| apt-get -qq install sudo | |
| rm -rf /var/lib/apt/lists/* | |
| - name: Update $HOME | |
| run: echo "HOME=/root" >> "$GITHUB_ENV" | |
| - name: Activate OpenFOAM # From https://github.com/gerlero/setup-openfoam/blob/68e0bf96c7f2aac1a100291a5d61fff934a472a8/action.yml#L54-L69 | |
| run: | | |
| old_path="$PATH" | |
| source /usr/lib/openfoam/openfoam2412/etc/bashrc || true | |
| for var in "${!WM_@}"; do | |
| echo "$var=${!var}" >> "$GITHUB_ENV" | |
| done | |
| for var in "${!FOAM_@}"; do | |
| echo "$var=${!var}" >> "$GITHUB_ENV" | |
| done | |
| echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> "$GITHUB_ENV" | |
| echo "${PATH/%:$old_path}" >> "$GITHUB_PATH" | |
| - name: Print some debug output | |
| # problematic: export WM_PROJECT_USER_DIR="$HOME/$WM_PROJECT/${USER:-user}-$WM_PROJECT_VERSION" | |
| run: | | |
| echo $WM_PROJECT_USER_DIR | |
| echo $HOME | |
| echo $WM_PROJECT | |
| echo $USER | |
| echo $WM_PROJECT_VERSION | |
| - name: Check user | |
| run: whoami | |
| - name: Setup tmate session | |
| uses: mxschmitt/action-tmate@v3 | |
| with: | |
| detached: true | |
| limit-access-to-actor: true | |
| - name: Install Dependencies | |
| run: | | |
| apt-get -qq update | |
| apt-get -qq install python3-dev python3-pip python3.12-venv git apt-utils pkg-config | |
| rm -rf /var/lib/apt/lists/* | |
| - name: Create venv | |
| run: | | |
| ./make-venv.sh | |
| - name: Create venv for solid-fenics | |
| run: | | |
| cd solid-fenics | |
| python3 -m venv --system-site-packages .venv | |
| . .venv/bin/activate | |
| pip install -r requirements.txt | |
| - name: Run tutorial | |
| run: | | |
| . .venv/bin/activate | |
| python3 doConvergenceStudy.py precice-config-template.xml --silent --executor Github ${{matrix.experiment.args}} | |
| - name: Store logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logs ${{ matrix.experiment.name }} | |
| path: | | |
| perpendicular-flap/fluid-openfoam/stdout-Fluid.log | |
| perpendicular-flap/solid-fenics/stdout-Solid.log | |
| - name: Store results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perpendicular-flap ${{ matrix.experiment.name }} | |
| path: | | |
| # working directory is ignored by actions/upload-artifact | |
| ./perpendicular-flap/studies | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: run_experiments | |
| steps: | |
| - name: Merge results | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: perpendicular-flap |