From 67e835f5c9f8059e5a3e551a238a6e7c5e3e4add Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 17:57:57 +0100 Subject: [PATCH 01/21] Update badges --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d31a4de9..e031895e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # OpenFOAM-preCICE adapter +[![Ask questions in the forum](https://img.shields.io/badge/community-discourse_forum-orange?link=https%3A%2F%2Fprecice.discourse.group%2F)](https://precice.discourse.group/) [![Build with OpenFOAM v2306](https://github.com/precice/openfoam-adapter/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/precice/openfoam-adapter/actions/workflows/build.yml) [![Changelog](https://img.shields.io/badge/Keep%20a%20Changelog--555.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IiNmMTVkMzAiIHZpZXdCb3g9IjAgMCAxODcgMTg1Ij48cGF0aCBkPSJNNjIgN2MtMTUgMy0yOCAxMC0zNyAyMmExMjIgMTIyIDAgMDAtMTggOTEgNzQgNzQgMCAwMDE2IDM4YzYgOSAxNCAxNSAyNCAxOGE4OSA4OSAwIDAwMjQgNCA0NSA0NSAwIDAwNiAwbDMtMSAxMy0xYTE1OCAxNTggMCAwMDU1LTE3IDYzIDYzIDAgMDAzNS01MiAzNCAzNCAwIDAwLTEtNWMtMy0xOC05LTMzLTE5LTQ3LTEyLTE3LTI0LTI4LTM4LTM3QTg1IDg1IDAgMDA2MiA3em0zMCA4YzIwIDQgMzggMTQgNTMgMzEgMTcgMTggMjYgMzcgMjkgNTh2MTJjLTMgMTctMTMgMzAtMjggMzhhMTU1IDE1NSAwIDAxLTUzIDE2bC0xMyAyaC0xYTUxIDUxIDAgMDEtMTItMWwtMTctMmMtMTMtNC0yMy0xMi0yOS0yNy01LTEyLTgtMjQ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GNU GPL license - - +[![License](https://img.shields.io/github/license/precice/openfoam-adapter.svg)](https://github.com/precice/openfoam-adapter/blob/master/LICENSE) ## Start here From 4bdfc82b1a7d983bfe184ed3fd3c397b93c8ce21 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:05:37 +0100 Subject: [PATCH 02/21] Bump OpenFOAM version to v2312 --- .github/workflows/build-custom.yml | 5 +++++ .github/workflows/build.yml | 4 ++-- .github/workflows/install-openfoam.sh | 4 ++-- .github/workflows/system-tests.yaml | 2 +- README.md | 2 +- docs/openfoam-support.md | 8 ++++---- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 28f406cf..3d3086bd 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -20,6 +20,7 @@ on: required: true type: choice options: + - OpenFOAMv2312 - OpenFOAMv2306 - OpenFOAMv2212 - OpenFOAMv2206 @@ -81,6 +82,10 @@ jobs: id: installOpenFOAM run: | case "${{ github.event.inputs.versionOpenFOAM }}" in + OpenFOAMv2312) + wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash + sudo apt-get install openfoam2312-dev + echo "{openfoam_exec}={/usr/bin/openfoam2312}" >> $GITHUB_OUTPUT;; OpenFOAMv2306) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2306-dev diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac7c2cce..a8043522 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build with OpenFOAM v2306 +name: Build with OpenFOAM v2312 on: push: branches-ignore: @@ -43,4 +43,4 @@ jobs: with: precice-version: develop - name: Build OpenFOAM-preCICE adapter - run: /usr/bin/openfoam2306 ./Allwmake + run: /usr/bin/openfoam2312 ./Allwmake diff --git a/.github/workflows/install-openfoam.sh b/.github/workflows/install-openfoam.sh index 99788a3f..9246a7c3 100755 --- a/.github/workflows/install-openfoam.sh +++ b/.github/workflows/install-openfoam.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -# Install OpenFOAM v2306 +# Install OpenFOAM v2312 wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get update -sudo apt-get install openfoam2306-dev +sudo apt-get install openfoam2312-dev diff --git a/.github/workflows/system-tests.yaml b/.github/workflows/system-tests.yaml index d72794aa..e6e6145f 100644 --- a/.github/workflows/system-tests.yaml +++ b/.github/workflows/system-tests.yaml @@ -24,6 +24,6 @@ jobs: uses: precice/tutorials/.github/workflows/run_testsuite_workflow.yml@develop with: suites: openfoam_adapter_pr - build_args: TUTORIALS_REF:${{ needs.gather-refs.outputs.reftutorials }},PRECICE_REF:v3.0.0,OPENFOAM_EXECUTABLE:openfoam2306,OPENFOAM_ADAPTER_REF:${{ github.event.pull_request.head.sha }} + build_args: TUTORIALS_REF:${{ needs.gather-refs.outputs.reftutorials }},PRECICE_REF:v3.0.0,OPENFOAM_EXECUTABLE:openfoam2312,OPENFOAM_ADAPTER_REF:${{ github.event.pull_request.head.sha }} systests_branch: develop loglevel: "DEBUG" diff --git a/README.md b/README.md index e031895e..9d6c465e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # OpenFOAM-preCICE adapter [![Ask questions in the forum](https://img.shields.io/badge/community-discourse_forum-orange?link=https%3A%2F%2Fprecice.discourse.group%2F)](https://precice.discourse.group/) -[![Build with OpenFOAM v2306](https://github.com/precice/openfoam-adapter/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/precice/openfoam-adapter/actions/workflows/build.yml) +[![Build with OpenFOAM v2312](https://github.com/precice/openfoam-adapter/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/precice/openfoam-adapter/actions/workflows/build.yml) [![Changelog](https://img.shields.io/badge/Keep%20a%20Changelog--555.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR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LTUgMzItMyA1MCA5IDEzIDggMjMgMjAgMzAgMzYgNyAxNSA3IDI5IDAgNDJ6bS00My03M2MtMTctOC0zMy02LTQ2IDUtMTAgOC0xNiAyMC0xOSAzN2E1NCA1NCAwIDAwNSAzNGM3IDE1IDIwIDIzIDM3IDIyIDIyLTEgMzgtOSA0OC0yNGE0MSA0MSAwIDAwOC0yNCA0MyA0MyAwIDAwLTEtMTJjLTYtMTgtMTYtMzEtMzItMzh6bS0yMyA5MWgtMWMtNyAwLTE0LTItMjEtN2EyNyAyNyAwIDAxLTEwLTEzIDU3IDU3IDAgMDEtNC0yMCA2MyA2MyAwIDAxNi0yNWM1LTEyIDEyLTE5IDI0LTIxIDktMyAxOC0yIDI3IDIgMTQgNiAyMyAxOCAyNyAzM3MtMiAzMS0xNiA0MGMtMTEgOC0yMSAxMS0zMiAxMXptMS0zNHYxNGgtOFY2OGg4djI4bDEwLTEwaDExbC0xNCAxNSAxNyAxOEg5NnoiLz48L3N2Zz4K)](https://github.com/precice/openfoam-adapter/blob/develop/CHANGELOG.md) [![License](https://img.shields.io/github/license/precice/openfoam-adapter.svg)](https://github.com/precice/openfoam-adapter/blob/master/LICENSE) diff --git a/docs/openfoam-support.md b/docs/openfoam-support.md index 72868ff1..fb8fc0df 100644 --- a/docs/openfoam-support.md +++ b/docs/openfoam-support.md @@ -7,14 +7,14 @@ summary: Recent OpenFOAM.com versions work out-of-the-box. Recent OpenFOAM.org v ## How to get OpenFOAM -The easiest way to start is to get binary packages for your Linux distribution. For example, to [get OpenFOAM v2306 on Ubuntu](https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/debian#precompiled-packages-debianubuntu): +The easiest way to start is to get binary packages for your Linux distribution. For example, to [get OpenFOAM v2312 on Ubuntu](https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/debian#precompiled-packages-debianubuntu): ```bash # Add the signing key, add the repository, update: wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash -# Install OpenFOAM v2306: -sudo apt-get install openfoam2306-dev +# Install OpenFOAM v2312: +sudo apt-get install openfoam2312-dev ``` As these steps change your `.profile`, you need to log out and in again to make OpenFOAM fully discoverable. @@ -26,7 +26,7 @@ OpenFOAM is a project with long history and many forks, of which we try to suppo We provide version-specific [release archives](https://github.com/precice/openfoam-adapter/releases/latest) and respective Git branches for: - OpenCFD / ESI (openfoam.com) - main focus: - - [OpenFOAM v1812-v2306](https://github.com/precice/openfoam-adapter) or newer + - [OpenFOAM v1812-v2312](https://github.com/precice/openfoam-adapter) or newer - OpenFOAM v2212 and newer is only supported since v1.2.2 of the adapter. - [OpenFOAM v1612-v1806](https://github.com/precice/openfoam-adapter/tree/OpenFOAMv1806) (not tested) - OpenFOAM Foundation (openfoam.org) - secondary, consider experimental: From 306f183174d3c1fdcaef1adf116dca7f8c08ea1c Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:07:49 +0100 Subject: [PATCH 03/21] Update note on v1.2.3 and preCICE v2 --- docs/get.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/get.md b/docs/get.md index b2fb53f9..d58fdf34 100644 --- a/docs/get.md +++ b/docs/get.md @@ -8,7 +8,8 @@ summary: "Get the code from GitHub and run ./Allwmake. If this fails, look into To build the adapter, you need to install a few dependencies and then execute the `Allwmake` script. 1. Install [a compatible OpenFOAM distribution](https://precice.org/adapter-openfoam-support.html). -2. Install [preCICE v3](https://precice.org/installation-overview.html). In case you need preCICE v2, please install an older version of the adapter (v1.2.3 is the latest release to support preCICE v2). +2. Install [preCICE v3](https://precice.org/installation-overview.html). + * In case you need preCICE v2, please install an older version of the adapter (v1.2.3 was the last release to support preCICE v2). 3. [Download the latest release](https://github.com/precice/openfoam-adapter/releases/latest) for your OpenFOAM version. 4. Execute the build script: `./Allwmake`. * See and adjust the configuration in the beginning of the script first, if needed. From 1241db9ef06fbee1abfdfaa0608d56ed63144e6c Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:15:37 +0100 Subject: [PATCH 04/21] Use precice/precice:nightly instead of setup-precice-action --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8043522..48cd700a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ on: jobs: build: runs-on: ubuntu-22.04 + container: precice/precice:nightly steps: - name: Check out repository uses: actions/checkout@v4 @@ -38,9 +39,5 @@ jobs: cache: ${{ runner.temp }}/cache-directory snapshot: '/' exclude: '/boot /data /dev /mnt /proc /run /sys' - - name: Install preCICE - uses: precice/setup-precice-action@main - with: - precice-version: develop - name: Build OpenFOAM-preCICE adapter run: /usr/bin/openfoam2312 ./Allwmake From ad0f6c9ccb1c620e0a4cc77d55b2e38a3c9f87ab Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:18:49 +0100 Subject: [PATCH 05/21] build.yml: Install sudo --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48cd700a..e1ae1321 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,9 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 + - name: Install action dependencies + run: | + apt install -qq sudo - name: Setup caches uses: actions/cache@v4 id: cache-id From 2be7bef7892a5c34bdce125ebf237a11adc2275b Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:20:42 +0100 Subject: [PATCH 06/21] Update APT repos before installing packages --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1ae1321..98f9dd49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,8 @@ jobs: uses: actions/checkout@v4 - name: Install action dependencies run: | - apt install -qq sudo + apt-get update -qq + apt-get install -qq sudo - name: Setup caches uses: actions/cache@v4 id: cache-id From a641d80c6ef0b26b3cd5c32240e2a6932e81d64a Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:23:22 +0100 Subject: [PATCH 07/21] Install wget --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98f9dd49..5b6b5927 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: Install action dependencies run: | apt-get update -qq - apt-get install -qq sudo + apt-get install -qq sudo wget - name: Setup caches uses: actions/cache@v4 id: cache-id From 0373f5b3cfdace416ce50cea71d4ee573424032b Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:26:48 +0100 Subject: [PATCH 08/21] Install OpenFOAM: assume yes --- .github/workflows/install-openfoam.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install-openfoam.sh b/.github/workflows/install-openfoam.sh index 9246a7c3..3b132427 100755 --- a/.github/workflows/install-openfoam.sh +++ b/.github/workflows/install-openfoam.sh @@ -2,5 +2,5 @@ # Install OpenFOAM v2312 wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash -sudo apt-get update -sudo apt-get install openfoam2312-dev +sudo apt-get update -y +sudo apt-get install -y openfoam2312-dev From 861fbef4c8c9c856765f4b3fc1c969bba360ea72 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:39:11 +0100 Subject: [PATCH 09/21] Move shellcheck to pre-commit --- .github/workflows/check-links.yml | 14 -------------- .pre-commit-config.yaml | 5 +++++ 2 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/check-links.yml diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml deleted file mode 100644 index 86870258..00000000 --- a/.github/workflows/check-links.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Check links (manual) -on: workflow_dispatch -jobs: - check_links: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v4 - - name: Check links in markdown files (markdown-link-check) - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'no' - config-file: '.markdown-link-check-config.json' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 51cd7ebc..f3554f66 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,8 @@ repos: files: "^docs/.*.md" - id: markdownlint-fix files: "^docs/.*.md" +- repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.10.0 + hooks: + - id: shellcheck + args: [ --external-sources, --exclude=SC1091 ] From a56f179d8ece4eebf0c5193b752cfc65fd1270b1 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 21:40:40 +0100 Subject: [PATCH 10/21] Rename check-style to pre-commit --- .github/workflows/{check-style.yml => pre-commit.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{check-style.yml => pre-commit.yml} (95%) diff --git a/.github/workflows/check-style.yml b/.github/workflows/pre-commit.yml similarity index 95% rename from .github/workflows/check-style.yml rename to .github/workflows/pre-commit.yml index c7476502..f87390de 100644 --- a/.github/workflows/check-style.yml +++ b/.github/workflows/pre-commit.yml @@ -1,4 +1,4 @@ -name: Check code style +name: Pre-commit hook checks on: push: branches: From 62a7384fd8ea58ff76f1b362dac1f5f070e22774 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 19:14:28 +0100 Subject: [PATCH 11/21] Add link to v1.2.3 --- docs/get.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get.md b/docs/get.md index d58fdf34..5460106d 100644 --- a/docs/get.md +++ b/docs/get.md @@ -9,7 +9,7 @@ To build the adapter, you need to install a few dependencies and then execute th 1. Install [a compatible OpenFOAM distribution](https://precice.org/adapter-openfoam-support.html). 2. Install [preCICE v3](https://precice.org/installation-overview.html). - * In case you need preCICE v2, please install an older version of the adapter (v1.2.3 was the last release to support preCICE v2). + * In case you need preCICE v2, please install an older version of the adapter ([v1.2.3](https://github.com/precice/openfoam-adapter/releases/tag/v1.2.3) was the last release to support preCICE v2). 3. [Download the latest release](https://github.com/precice/openfoam-adapter/releases/latest) for your OpenFOAM version. 4. Execute the build script: `./Allwmake`. * See and adjust the configuration in the beginning of the script first, if needed. From 5b3ca509f90a5c5ab24860ec01998a225bf23edd Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 19:24:17 +0100 Subject: [PATCH 12/21] build-custom: Replace preCICE Debian package with setup-precice-action --- .github/workflows/build-custom.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 3d3086bd..1457d2d3 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -37,7 +37,7 @@ on: - OpenFOAM5 versionpreCICE: description: 'Version of preCICE to build with' - default: '2.5.0' + default: '3.0.0' required: true runTutorialHeatedPlate: description: Run tutorial flow-over-heated-plate @@ -161,20 +161,9 @@ jobs: exit 1;; esac - name: Install preCICE (no cache) - run: | - if [ "${{ github.event.inputs.virtualEnvironment }}" == "ubuntu-22.04" ] - then - wget "https://github.com/precice/precice/releases/download/v${{ github.event.inputs.versionpreCICE }}/libprecice2_${{ github.event.inputs.versionpreCICE }}_jammy.deb" - sudo apt install "./libprecice2_${{ github.event.inputs.versionpreCICE }}_jammy.deb" - elif [ "${{ github.event.inputs.virtualEnvironment }}" == "ubuntu-20.04" ] - then - wget "https://github.com/precice/precice/releases/download/v${{ github.event.inputs.versionpreCICE }}/libprecice2_${{ github.event.inputs.versionpreCICE }}_focal.deb" - sudo apt install "./libprecice2_${{ github.event.inputs.versionpreCICE }}_focal.deb" - elif [ "${{ github.event.inputs.virtualEnvironment }}" == "ubuntu-18.04" ] - then - wget "https://github.com/precice/precice/releases/download/v${{ github.event.inputs.versionpreCICE }}/libprecice2_${{ github.event.inputs.versionpreCICE }}_bionic.deb" - sudo apt install "./libprecice2_${{ github.event.inputs.versionpreCICE }}_bionic.deb" - fi + uses: precice/setup-precice-action@main + with: + precice-version: ${{ github.event.inputs.versionpreCICE }} - name: Build OpenFOAM-preCICE adapter run: | ${{steps.installOpenFOAM.outputs.openfoam_exec}} ./Allwmake From 08f6a57e60d3680a742d8f1dd50e8fe354cdcca1 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 19:34:14 +0100 Subject: [PATCH 13/21] Add v to preCICE version --- .github/workflows/build-custom.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 1457d2d3..cb028f5f 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -163,7 +163,7 @@ jobs: - name: Install preCICE (no cache) uses: precice/setup-precice-action@main with: - precice-version: ${{ github.event.inputs.versionpreCICE }} + precice-version: v${{ github.event.inputs.versionpreCICE }} - name: Build OpenFOAM-preCICE adapter run: | ${{steps.installOpenFOAM.outputs.openfoam_exec}} ./Allwmake From 213b942107b091e19a73fa2efbb628965546373c Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 19:51:28 +0100 Subject: [PATCH 14/21] Move preCICE installation step up --- .github/workflows/build-custom.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index cb028f5f..ce7c0688 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -78,6 +78,10 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.refAdapter }} + - name: Install preCICE (no cache) + uses: precice/setup-precice-action@main + with: + precice-version: v${{ github.event.inputs.versionpreCICE }} - name: Install OpenFOAM (no cache) id: installOpenFOAM run: | @@ -160,10 +164,6 @@ jobs: echo "I cannot find ${{ github.event.inputs.refAdapter }} in my known options." exit 1;; esac - - name: Install preCICE (no cache) - uses: precice/setup-precice-action@main - with: - precice-version: v${{ github.event.inputs.versionpreCICE }} - name: Build OpenFOAM-preCICE adapter run: | ${{steps.installOpenFOAM.outputs.openfoam_exec}} ./Allwmake From 9956800ff4c3fda4ab9630ebbc26e3daf5fa8279 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 19:53:01 +0100 Subject: [PATCH 15/21] Remove v again, to allow for any version --- .github/workflows/build-custom.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index ce7c0688..96436546 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -37,7 +37,7 @@ on: - OpenFOAM5 versionpreCICE: description: 'Version of preCICE to build with' - default: '3.0.0' + default: 'v3.0.0' required: true runTutorialHeatedPlate: description: Run tutorial flow-over-heated-plate @@ -81,7 +81,7 @@ jobs: - name: Install preCICE (no cache) uses: precice/setup-precice-action@main with: - precice-version: v${{ github.event.inputs.versionpreCICE }} + precice-version: ${{ github.event.inputs.versionpreCICE }} - name: Install OpenFOAM (no cache) id: installOpenFOAM run: | From b38567d598d2d337d69299615b3418aaff1f4d44 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 20:22:29 +0100 Subject: [PATCH 16/21] Debugging --- .github/workflows/build-custom.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 96436546..4b8f6b0b 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -166,6 +166,7 @@ jobs: esac - name: Build OpenFOAM-preCICE adapter run: | + echo "OpenFOAM environment: ${{steps.installOpenFOAM.outputs.openfoam_exec}}" ${{steps.installOpenFOAM.outputs.openfoam_exec}} ./Allwmake - name: Get tutorials run: | From f939c7aa90ed7837b75360771c62056d8878579a Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 20:47:22 +0100 Subject: [PATCH 17/21] Debugging --- .github/workflows/build-custom.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 4b8f6b0b..bd61fb75 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -89,44 +89,45 @@ jobs: OpenFOAMv2312) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2312-dev - echo "{openfoam_exec}={/usr/bin/openfoam2312}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2312 openfoam_exec;; OpenFOAMv2306) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2306-dev - echo "{openfoam_exec}={/usr/bin/openfoam2306}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2306 openfoam_exec;; OpenFOAMv2212) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2212-dev - echo "{openfoam_exec}={/usr/bin/openfoam2212}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2212 openfoam_exec;; OpenFOAMv2206) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2206-dev - echo "{openfoam_exec}={/usr/bin/openfoam2206}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2206 openfoam_exec;; OpenFOAMv2112) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2112-dev - echo "{openfoam_exec}={/usr/bin/openfoam2112}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2112 openfoam_exec;; OpenFOAMv2106) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2106-dev - echo "{openfoam_exec}={/usr/bin/openfoam2106}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2106 openfoam_exec;; OpenFOAMv2012) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2012-dev - echo "{openfoam_exec}={/usr/bin/openfoam2012}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2012 openfoam_exec;; OpenFOAMv2006) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2006-dev - echo "{openfoam_exec}={/usr/bin/openfoam2006}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam2006 openfoam_exec;; OpenFOAMv1912) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam1912-dev - echo "{openfoam_exec}={/usr/bin/openfoam1912}" >> $GITHUB_OUTPUT;; + ln -s /usr/bin/openfoam1912 openfoam_exec;; OpenFOAM10) sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -" sudo add-apt-repository http://dl.openfoam.org/ubuntu sudo apt-get update sudo apt-get -y install openfoam10 + # Output of such variables seems to currently be broken in GitHub Actions echo "{openfoam_exec}={. /opt/openfoam10/etc/bashrc &&}" >> $GITHUB_OUTPUT;; OpenFOAM9) sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -" @@ -166,8 +167,7 @@ jobs: esac - name: Build OpenFOAM-preCICE adapter run: | - echo "OpenFOAM environment: ${{steps.installOpenFOAM.outputs.openfoam_exec}}" - ${{steps.installOpenFOAM.outputs.openfoam_exec}} ./Allwmake + ./openfoam_exec ./Allwmake - name: Get tutorials run: | git clone https://github.com/precice/tutorials.git --branch ${{ github.event.inputs.branchTutorials }} --depth 1 From 8012fd95da095d7aa9c4d8f714e756777dd78e87 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 20:58:28 +0100 Subject: [PATCH 18/21] Reuse output as env --- .github/workflows/build-custom.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index bd61fb75..f8a8eeeb 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -89,45 +89,44 @@ jobs: OpenFOAMv2312) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2312-dev - ln -s /usr/bin/openfoam2312 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2312}" >> $GITHUB_OUTPUT;; OpenFOAMv2306) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2306-dev - ln -s /usr/bin/openfoam2306 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2306}" >> $GITHUB_OUTPUT;; OpenFOAMv2212) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2212-dev - ln -s /usr/bin/openfoam2212 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2212}" >> $GITHUB_OUTPUT;; OpenFOAMv2206) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2206-dev - ln -s /usr/bin/openfoam2206 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2206}" >> $GITHUB_OUTPUT;; OpenFOAMv2112) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2112-dev - ln -s /usr/bin/openfoam2112 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2112}" >> $GITHUB_OUTPUT;; OpenFOAMv2106) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2106-dev - ln -s /usr/bin/openfoam2106 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2106}" >> $GITHUB_OUTPUT;; OpenFOAMv2012) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2012-dev - ln -s /usr/bin/openfoam2012 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2012}" >> $GITHUB_OUTPUT;; OpenFOAMv2006) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam2006-dev - ln -s /usr/bin/openfoam2006 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam2006}" >> $GITHUB_OUTPUT;; OpenFOAMv1912) wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash sudo apt-get install openfoam1912-dev - ln -s /usr/bin/openfoam1912 openfoam_exec;; + echo "{openfoam_exec}={/usr/bin/openfoam1912}" >> $GITHUB_OUTPUT;; OpenFOAM10) sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -" sudo add-apt-repository http://dl.openfoam.org/ubuntu sudo apt-get update sudo apt-get -y install openfoam10 - # Output of such variables seems to currently be broken in GitHub Actions echo "{openfoam_exec}={. /opt/openfoam10/etc/bashrc &&}" >> $GITHUB_OUTPUT;; OpenFOAM9) sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -" @@ -166,8 +165,11 @@ jobs: exit 1;; esac - name: Build OpenFOAM-preCICE adapter + env: + OPENFOAM_EXEC: ${{steps.installOpenFOAM.outputs.openfoam_exec}} run: | - ./openfoam_exec ./Allwmake + echo "OpenFOAM environment: $OPENFOAM_EXEC" + $OPENFOAM_EXEC ./Allwmake - name: Get tutorials run: | git clone https://github.com/precice/tutorials.git --branch ${{ github.event.inputs.branchTutorials }} --depth 1 From 8057f4e94fb44c2a933936b9dc621beb958ebb92 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 21:04:52 +0100 Subject: [PATCH 19/21] Revert back to previous step output state --- .github/workflows/build-custom.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index f8a8eeeb..4b8f6b0b 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -165,11 +165,9 @@ jobs: exit 1;; esac - name: Build OpenFOAM-preCICE adapter - env: - OPENFOAM_EXEC: ${{steps.installOpenFOAM.outputs.openfoam_exec}} run: | - echo "OpenFOAM environment: $OPENFOAM_EXEC" - $OPENFOAM_EXEC ./Allwmake + echo "OpenFOAM environment: ${{steps.installOpenFOAM.outputs.openfoam_exec}}" + ${{steps.installOpenFOAM.outputs.openfoam_exec}} ./Allwmake - name: Get tutorials run: | git clone https://github.com/precice/tutorials.git --branch ${{ github.event.inputs.branchTutorials }} --depth 1 From 70d4adc9ad4212a03c9e133c6598102133fd0d84 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 21:13:43 +0100 Subject: [PATCH 20/21] Add a sanity check --- .github/workflows/build-custom.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 4b8f6b0b..158b00b8 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -164,6 +164,11 @@ jobs: echo "I cannot find ${{ github.event.inputs.refAdapter }} in my known options." exit 1;; esac + - name: Sanity check + run: | + ls /usr/bin/openfoam* + ls /opt/openfoam* + echo ${{steps.installOpenFOAM.outputs.openfoam_exec}} - name: Build OpenFOAM-preCICE adapter run: | echo "OpenFOAM environment: ${{steps.installOpenFOAM.outputs.openfoam_exec}}" From 656d4c01cd6147677a03298d9ec6b540e3aee798 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 21:18:42 +0100 Subject: [PATCH 21/21] Extend sanity check --- .github/workflows/build-custom.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-custom.yml b/.github/workflows/build-custom.yml index 158b00b8..eec2d4ed 100644 --- a/.github/workflows/build-custom.yml +++ b/.github/workflows/build-custom.yml @@ -166,8 +166,9 @@ jobs: esac - name: Sanity check run: | - ls /usr/bin/openfoam* - ls /opt/openfoam* + ls /usr/bin/openfoam* || echo "No /usr/bin/openfoam* directories." + ls /opt/openfoam* || echo "No /opt/openfoam* directories." + echo "GitHub Actions step output openfoam_exec:" echo ${{steps.installOpenFOAM.outputs.openfoam_exec}} - name: Build OpenFOAM-preCICE adapter run: |