one ro-crate per tool, automatic creation of snakefile for a tool workflow #528
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: | |
| 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 | |
| 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: Set strict channel priority | |
| run: conda config --set channel_priority strict | |
| - name: Update environment | |
| run: mamba env update -n model-validation -f environment_benchmarks.yml | |
| - name: generate-config-files | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/linear-elastic-plate-with-hole/ | |
| python generate_config.py | |
| - name: generate-snakemake-fenics-workflow | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/common/ | |
| python simulation_tool_snakefile_generator.py --benchmark_name linear-elastic-plate-with-hole --tool fenics --simulation_script run_fenics_simulation.py --environment_file environment_simulation.yml | |
| - name: run_linear-elastic-plate-with-hole-benchmarks_snakemake | |
| shell: bash -l {0} | |
| run: | | |
| cd $GITHUB_WORKSPACE/benchmarks/linear-elastic-plate-with-hole/ | |
| snakemake --use-conda --force --cores 'all' --config tool="fenics" | |
| snakemake --use-conda --force --cores all --config tool="fenics" \ | |
| --reporter metadata4ing \ | |
| --report-metadata4ing-paramscript ../common/parameter_extractor.py \ | |
| --report-metadata4ing-filename snakemake_provenance_fenics | |
| unzip snakemake_provenance_fenics -d snakemake_provenance_fenics | |
| snakemake --use-conda --force --cores 'all' --config tool="kratos" | |
| snakemake --use-conda --force --cores all --config tool="kratos" \ | |
| --reporter metadata4ing \ | |
| --report-metadata4ing-paramscript ../common/parameter_extractor.py \ | |
| --report-metadata4ing-filename snakemake_provenance_kratos | |
| unzip snakemake_provenance_kratos -d snakemake_provenance_kratos | |
| - name: Archive Linear Elastic plate with a hole benchmark data for snakemake fenics | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: snakemake_fenics_result_linear-elastic-plate-with-hole | |
| path: | | |
| benchmarks/linear-elastic-plate-with-hole/snakemake_provenance_fenics/ | |
| - name: Archive Linear Elastic plate with a hole benchmark data for snakemake kratos | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: snakemake_kratos_result_linear-elastic-plate-with-hole | |
| path: | | |
| benchmarks/linear-elastic-plate-with-hole/snakemake_provenance_kratos/ | |
| process-artifacts: | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| steps: | |
| - name: Checkout repo content | |
| uses: actions/checkout@v2 | |
| - name: Download snakemake fenics artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: snakemake_fenics_result_linear-elastic-plate-with-hole | |
| path: ./snakemake_fenics_provenance | |
| - name: Download snakemake kratos artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: snakemake_kratos_result_linear-elastic-plate-with-hole | |
| path: ./snakemake_kratos_provenance | |
| - name: Setup Mambaforge with postprocessing env | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: postprocessing | |
| use-mamba: true | |
| environment-file: benchmarks/linear-elastic-plate-with-hole/environment_postprocessing.yml | |
| - name: Run plotting script | |
| shell: bash -l {0} | |
| run: | | |
| python benchmarks/linear-elastic-plate-with-hole/plot_metrics.py ./snakemake_fenics_provenance ./snakemake_kratos_provenance | |
| - name: Upload PDF plot as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: element-size-vs-stress-plot | |
| path: element_size_vs_stress.pdf |