Skip to content

Commit

Permalink
Merge pull request FloatingArrayDesign#137 from FloatingArrayDesign/dev
Browse files Browse the repository at this point in the history
Version 2.2.1
  • Loading branch information
RyanDavies19 authored Sep 28, 2023
2 parents 65166bc + 55667f4 commit ff2888f
Show file tree
Hide file tree
Showing 49 changed files with 3,173 additions and 2,202 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-mingw.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CMake
name: MinGW

on:
push:
branches: [ $default-branch, master, v2 ]
branches: [ $default-branch, master ]
pull_request:
branches:
- "**"
Expand All @@ -21,7 +21,7 @@ jobs:
os: [windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Create folders
run: |
Expand All @@ -32,5 +32,4 @@ jobs:
run: cmake -B ${{github.workspace}}/build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=ON -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=OFF -DBUILD_TESTING=ON

- name: Build
id: build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
64 changes: 40 additions & 24 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CMake

on:
push:
branches: [ $default-branch, master, v2 ]
branches: [ $default-branch, master ]
pull_request:
branches:
- "**"
Expand All @@ -24,23 +24,33 @@ jobs:
release_id: ${{ steps.create_release.outputs.id }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: github.event_name == 'push'

- uses: dev-drprasad/[email protected]
continue-on-error: true
with:
delete_release: true
tag_name: "nightly"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: moordyn_tag_name
id: moordyn_tag_name
shell: bash
run: |
major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
echo "moordyn_tag_name=v$major.$minor.$patch" >> $GITHUB_OUTPUT
if: github.event_name == 'push'

# - uses: dev-drprasad/[email protected]
# continue-on-error: true
# with:
# delete_release: true
# tag_name: "nightly"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# if: github.event_name == 'push'

- uses: rickstaa/action-create-tag@v1
id: create_tag
with:
tag: "nightly"
message: "Latest release"
tag: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}}
message: "Latest release (${{steps.moordyn_tag_name.outputs.moordyn_tag_name}})"
force_push_tag: true
if: github.event_name == 'push'

Expand All @@ -50,8 +60,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "nightly"
release_name: "nightly"
tag_name: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}}
release_name: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}}
draft: false
prerelease: false
if: github.event_name == 'push'
Expand All @@ -64,7 +74,7 @@ jobs:
os: [ubuntu-22.04, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: moordyn_version
id: moordyn_version
Expand All @@ -75,19 +85,15 @@ jobs:
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
echo "moordyn_version=$major.$minor.$patch" >> $GITHUB_OUTPUT
- name: Setup GCC Fortran (Linux & Mac)
- name: Setup GCC Fortran (Linux)
uses: awvwgk/setup-fortran@main
id: setup-fortran
with:
compiler: gcc
if: runner.os == 'Linux'

- name: Setup Intel Fortran
uses: modflowpy/install-intelfortran-action@v1
if: runner.os == 'Windows'

- name: download pre-built VTK static library
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz
target: ${{github.workspace}}/
Expand All @@ -106,22 +112,32 @@ jobs:
if: runner.os == 'Linux'

- name: Configure CMake (Windows)
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=ON -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=ON
if: runner.os == 'Windows'

- name: Configure CMake (Mac)
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=ON
if: runner.os == 'macOS'

- name: Build
id: build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test (Linux)
# We do a little hack here. We install the library so we perfectly know the
# path. Then we set the environment variable to let the OS find the
# libraries

- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Set $PATH (Windows)
run: Add-Content $env:GITHUB_PATH "${{github.workspace}}\install\bin"
if: runner.os == 'Windows'

- name: Test
working-directory: ${{github.workspace}}/build
# We are just testing in Linux
run: ctest -C ${{env.BUILD_TYPE}}
if: runner.os == 'Linux'

- name: Install
working-directory: ${{github.workspace}}/build
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/check-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check version

on:
pull_request:
branches: [ $default-branch, master ]

jobs:
check:
name: Check that the version is valid
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: moordyn_version
id: moordyn_version
shell: bash
run: |
major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
echo "moordyn_version=$major.$minor.$patch" >> $GITHUB_OUTPUT
- name: Tag check
uses: mukunku/[email protected]
id: checkTag
with:
tag: "v${{steps.moordyn_version.outputs.moordyn_version}}"

- name: Stop if tag exists
run: |
if [ ${{ steps.checkTag.outputs.exists }} == true ]; then exit 1; else exit 0; fi
56 changes: 44 additions & 12 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Python-Wheels

on:
push:
branches: [ $default-branch, master, v2-make-wheels ]
branches: [ $default-branch, master ]

permissions: write-all

Expand All @@ -29,10 +29,12 @@ jobs:
tar -xvzf vtk-Linux-`uname -m`.tar.gz -C vtk/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Create setup.py
run: |
Expand All @@ -47,42 +49,42 @@ jobs:
run: python -m pip install cibuildwheel

- name: download pre-built VTK static library (non-Linux)
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz
target: ${{github.workspace}}/
if: runner.os != 'Linux'

- name: download pre-built VTK static library (Linux-x86_64)
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Linux'

- name: download pre-built VTK static library (Linux-aarch64)
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-aarch64.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Linux'

- name: download pre-built VTK static library (Linux-armv7)
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-armv7.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Linux'

- name: download pre-built VTK static library (Linux-ppc64le)
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-ppc64le.tar.gz
target: ${{github.workspace}}/
if: runner.os == 'Linux'

- name: download pre-built VTK static library (Linux-s390x)
uses: suisei-cn/actions-download-file@v1.0.1
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-s390x.tar.gz
target: ${{github.workspace}}/
Expand All @@ -98,10 +100,40 @@ jobs:
tar -xvzf vtk-${{runner.os}}-x86_64.tar.gz -C vtk/
if: runner.os != 'Linux'

- name: Build the source distribution
run: python setup.py sdist
if: runner.os == 'Linux'

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
run: python -m cibuildwheel --output-dir dist

- uses: actions/upload-artifact@v3
id: build_wheels
with:
name: python-package-distributions
path: ./dist/*

publish:
runs-on: ${{ matrix.os }}
needs: [build_wheels]
strategy:
matrix:
os: [ubuntu-22.04]

steps:
- uses: actions/checkout@v4

- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
name: "Python wheels"
path: ./wheelhouse/*.whl
# password: ${{ secrets.MOORDYN_TESTPYPI_API }}
# repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.MOORDYN_PYPI_API }}
repository-url: https://upload.pypi.org/legacy/
skip-existing: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ dist

/source/.vscode
.vscode/*
docs/_build/*
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"
apt_packages:
- graphviz

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)
set(MOORDYN_MAJOR_VERSION 2)
set(MOORDYN_MINOR_VERSION 2)
set(MOORDYN_PATCH_VERSION 0)
set(MOORDYN_PATCH_VERSION 1)
set(MOORDYN_VERSION ${MOORDYN_MAJOR_VERSION}.${MOORDYN_MINOR_VERSION})
project(Moordyn VERSION ${MOORDYN_VERSION})

Expand All @@ -21,7 +21,7 @@ set(BUILD_DOCS OFF CACHE BOOL
"Build the documentation for users and developers")
set(BUILD_BENCHMARKS OFF CACHE BOOL
"Build the benchmarks. Makes use of Google's Benchmark library and requires an internet connection to download.")
set(EXTERNAL_EIGEN ON CACHE BOOL
set(EXTERNAL_EIGEN OFF CACHE BOOL
"Use the Eigen3 installed in the system")
set(USE_VTK OFF CACHE BOOL
"Link with VTK to produce output binary files")
Expand Down
Loading

0 comments on commit ff2888f

Please sign in to comment.