Skip to content

Commit

Permalink
feat(OpenGeode): Update to OpenGeode v12 standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
MelchiorSchuh authored and BotellaA committed Sep 29, 2022
1 parent ad0506a commit 10c9a28
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 42 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,30 @@ jobs:
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit

release-linux-python:
uses: Geode-solutions/actions/.github/workflows/cd-linux-python.yml@master
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
secrets: inherit

release-windows:
uses: Geode-solutions/actions/.github/workflows/cd-windows.yml@master
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit

release-windows-python:
uses: Geode-solutions/actions/.github/workflows/cd-windows-python.yml@master
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
secrets: inherit

notify:
uses: Geode-solutions/actions/.github/workflows/end-cd.yml@master
needs: [release-linux, release-linux-python, release-windows, release-windows-python]
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
31 changes: 14 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,52 @@ name: CI

on:
push:
pull_request:
schedule:
- cron: 0 0 * * *

jobs:
format:
uses: Geode-solutions/actions/.github/workflows/format.yml@master
secrets:
TOKEN: ${{ secrets.TOKEN }}
secrets: inherit

build-linux:
needs: format
uses: Geode-solutions/actions/.github/workflows/ci-linux.yml@master
with:
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit

build-linux-python:
needs: format
uses: Geode-solutions/actions/.github/workflows/ci-linux-python.yml@master
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit

coverage:
needs: format
uses: Geode-solutions/actions/.github/workflows/coverage.yml@master
with:
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
secrets: inherit

build-windows:
needs: format
uses: Geode-solutions/actions/.github/workflows/ci-windows.yml@master
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets:
TOKEN: ${{ secrets.TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit

build-windows-python:
needs: format
uses: Geode-solutions/actions/.github/workflows/ci-windows-python.yml@master
with:
name: OPENGEODE_MYMODULE
repos: OpenGeode
secrets: inherit

semantic-release:
needs: [build-linux, build-linux-python, build-windows]
uses: Geode-solutions/actions/.github/workflows/release.yml@master
secrets:
TOKEN: ${{ secrets.TOKEN }}
secrets: inherit
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.15)

cmake_policy(SET CMP0091 NEW)

# Define the project
project(OpenGeode-MyModule CXX)
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# SOFTWARE.


from .opengeode_mymodule_py_mylib import *
from .mylib import *
8 changes: 8 additions & 0 deletions bindings/python/mylib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2019 - 2022 Geode-solutions. All rights reserved.
#

import opengeode

from .opengeode_mymodule_py_mylib import *
MyModuleMyLib.initialize()
2 changes: 1 addition & 1 deletion bindings/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OpenGeode-core >= 10.0.16, == 10.*
OpenGeode-core >= 12.1.8, == 12.*
2 changes: 2 additions & 0 deletions bindings/python/src/mylib/mylib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
PYBIND11_MODULE( opengeode_mymodule_py_mylib, module )
{
module.doc() = "OpenGeode-ModuleTemplate Python binding for mylib";
pybind11::class_< mymodule::MyModuleMyLib >( module, "MyModuleMyLib" )
.def( "initialize", &mymodule::MyModuleMyLib::initialize );
module.def( "hello_world", &mymodule::hello_world );
}
14 changes: 14 additions & 0 deletions include/mylib/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2019 - 2022 Geode-solutions. All rights reserved.
*/

#pragma once

#include <geode/basic/common.h>
#include <geode/basic/library.h>
#include <mylib/opengeode_mymodule_mylib_export.h>

namespace mymodule
{
OPENGEODE_LIBRARY( opengeode_mymodule_mylib_api, MyModuleMyLib );
} // namespace mymodule
2 changes: 1 addition & 1 deletion include/mylib/hello_world.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#include <mylib/opengeode_mymodule_mylib_export.h>
#include <mylib/common.h>

namespace mymodule
{
Expand Down
9 changes: 6 additions & 3 deletions src/mylib/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
*
*/

#include <mylib/common.h>

#include <geode/basic/common.h>

namespace
namespace mymodule
{
OPENGEODE_LIBRARY_INITIALIZE( myLib )
OPENGEODE_LIBRARY_IMPLEMENTATION( MyModuleMyLib )
{
/* Here the functions to call when initializing the library
* For exemple: registers, ...
*/
geode::OpenGeodeBasic::initialize();
}
} // namespace
} // namespace mymodule
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.15)

if(NOT TARGET OpenGeode-MyModule::mylib)
project(OpenGeode-MyModule CXX)
Expand Down
1 change: 1 addition & 0 deletions tests/mylib/test-hello-world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ int main()
{
try
{
mymodule::MyModuleMyLib::initialize();
OPENGEODE_EXCEPTION(
mymodule::hello_world(), "[Test] Hello World is not correct" );

Expand Down

0 comments on commit 10c9a28

Please sign in to comment.