run OpenFOAM with snakemake #153
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: CI | |
| on: | |
| push: | |
| branches-ignore: | |
| pull_request: | |
| branches: [ main ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Runs the workflow once per day at 3:15am | |
| schedule: | |
| - cron: '3 16 * * *' | |
| env: | |
| CACHE_NUMBER: 1 # increase to reset cache manually | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: opencfd/openfoam-run:2412 | |
| steps: | |
| - name: checkout repo content | |
| uses: actions/checkout@v2 | |
| - name: Setup Mambaforge | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: model-validation | |
| use-mamba: true | |
| - name: Update environment | |
| run: mamba env update -n model-validation -f environment_benchmarks.yml | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| - name: Ensure log directory exists | |
| run: mkdir -p benchmarks/rotating-cylinder-OpenFOAM/.snakemake/log | |
| - name: run-OpenFOAM-benchmarks | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/rotating-cylinder-OpenFOAM/ | |
| mkdir -p ./.snakemake/log || true # bc. snakemake is not able to create this directory itself | |
| chmod +x Allrun | |
| echo "Starting snakemake" | |
| snakemake --cores 1 | |
| echo "Finished job." | |
| - name: run-fenics-benchmarks | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/linear-elasticity-plate-with-hole/ | |
| snakemake --use-conda --force --cores 'all' | |
| - name: run-Kratos-benchmarks | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/linear-elasticity-plate-with-hole-Kratos/ | |
| snakemake --use-conda --force --cores 'all' | |
| #- name: run-optimization-workflow | |
| # shell: bash -l {0} | |
| # run: | | |
| # cd $GITHUB_WORKSPACE/usecases/optimization_paper/optimization_workflow/ | |
| # snakemake -c 1 | |
| #- name: run-optimization-paper | |
| # shell: bash -l {0} | |
| # run: | | |
| # cd $GITHUB_WORKSPACE/usecases/optimization_paper/ | |
| # doit | |
| - name: Archive fenics data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fenics-output | |
| path: | | |
| benchmarks/linear-elasticity-plate-with-hole/data | |
| - name: Archive kratos data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kratos-output | |
| path: | | |
| benchmarks/linear-elasticity-plate-with-hole-Kratos/data | |
| test_rotCyl_OF: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: opencfd/openfoam-run:2412 | |
| steps: | |
| - name: Print debug information | |
| run: | | |
| echo "Running on OpenFOAM image" | |
| echo "Current directory: $PWD" | |
| echo "Available files:" | |
| ls -la | |
| - name: checkout repo content | |
| uses: actions/checkout@v2 | |
| - name: run-OpenFOAM-benchmarks | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/rotating-cylinder-OpenFOAM/ | |
| # sudo apt-get update && sudo apt-get install -y gnuplot | |
| chmod +x ./plot | |
| bash ./Allrun | |
| echo "Finished job" |