From d9c3e9d190b9098ab8c9015803e1d29f0b0d7167 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Thu, 16 May 2024 10:52:41 +0300 Subject: [PATCH] Add a workflow to build and test the adapter (#7) --- .github/workflows/build.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..500fefd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +name: Build and run +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: precice/precice:nightly + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install dependencies + run: | + apt-get -qq update + apt-get -qq install git cmake libblas-dev liblapack-dev libyaml-cpp-dev gfortran g++ + - name: Build OpenFAST + run: | + git clone https://github.com/OpenFAST/OpenFAST.git + cd OpenFAST + git switch --detach v3.5.3 + mkdir build + cd build + cmake -DBUILD_OPENFAST_CPP_API=ON .. + make -j $(nproc) + make install + - name: Build OpenFAST adapter + run: | + cd src + mkdir build + cd build + OpenFAST_DIR=../../OpenFAST/install/lib/cmake/OpenFAST cmake .. + make -j $(nproc) + - name: Build dummy-turbine fluid case + run: | + cd cases/dummy-turbine/fluid + cmake . + make -j $(nproc) + - name: Run dummy-turbine tutorial + run: | + cd cases/dummy-turbine/fluid + ./run.sh & + PIDOne=$! + cd ../openfast + PATH="../../../src/build/:${PATH}" ./run.sh & + PIDTwo=$! + wait $PIDOne + wait $PIDTwo