Skip to content

Commit 1e27503

Browse files
authored
fix(Build): update CI/CD workflows and active python bindings
1 parent 541c09b commit 1e27503

25 files changed

+417
-260
lines changed

.github/workflows/CD.yml

Lines changed: 33 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -4,100 +4,41 @@ on:
44
push:
55
tags: 'v*'
66

7-
jobs:
7+
jobs:
88
release-linux:
9-
runs-on: ubuntu-18.04
10-
container: ${{ matrix.config.container }}
11-
strategy:
12-
matrix:
13-
config:
14-
- {container: "geodesolutions/ubuntu", system: "ubuntu", doc: true}
15-
- {container: "geodesolutions/centos", system: "rhel", doc: false}
9+
uses: Geode-solutions/actions/.github/workflows/cd-linux.yml@master
10+
with:
11+
name: OPENGEODE_MYMODULE
12+
repos: OpenGeode
13+
secrets:
14+
TOKEN: ${{ secrets.TOKEN }}
15+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1616

17+
release-linux-python:
18+
uses: Geode-solutions/actions/.github/workflows/cd-linux-python.yml@master
19+
with:
20+
name: OPENGEODE_MYMODULE
21+
repos: OpenGeode
22+
secrets:
23+
TOKEN: ${{ secrets.TOKEN }}
24+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
25+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
1726

18-
steps:
19-
- uses: actions/checkout@v1
20-
- uses: Geode-solutions/actions/get-release@master
21-
id: opengeode
22-
with:
23-
repository: OpenGeode
24-
file: '-${{ matrix.config.system }}.tar.gz'
25-
token: ${{ secrets.TOKEN }}
26-
- name: Generate package
27-
id: package
28-
run: |
29-
mkdir -p build
30-
cd build
31-
version="${GITHUB_REF##*/*/}"
32-
echo ::set-output name=version::$version
33-
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} -DMYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$version -DCPACK_SYSTEM_NAME:STRING=${{ matrix.config.system }} ..
34-
cmake --build . -- -j2
35-
cmake --build . --target package
36-
- name: Upload
37-
uses: softprops/action-gh-release@v1
38-
with:
39-
files: "build/MyModule-${{ steps.package.outputs.version }}-${{ matrix.config.system }}.tar.gz"
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
- name: Doc
43-
if: matrix.config.doc
44-
run: curl -s https://raw.githubusercontent.com/Geode-solutions/actions/master/doc/doc.sh | bash -s -- ${GITHUB_WORKSPACE}/build
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.TOKEN }}
47-
48-
release-mac:
49-
runs-on: macOS-10.14
50-
51-
steps:
52-
- uses: actions/checkout@v1
53-
- uses: Geode-solutions/actions/get-release@master
54-
id: opengeode
55-
with:
56-
repository: OpenGeode
57-
file: '-darwin.tar.gz'
58-
token: ${{ secrets.TOKEN }}
59-
- name: Generate package
60-
id: package
61-
run: |
62-
mkdir -p build
63-
cd build
64-
version="${GITHUB_REF##*/*/}"
65-
echo ::set-output name=version::$version
66-
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} -DMYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$version -DCPACK_SYSTEM_NAME:STRING=darwin ..
67-
cmake --build . --config Release
68-
cmake --build . --target package --config Release
69-
- name: Upload
70-
uses: softprops/action-gh-release@v1
71-
with:
72-
files: "build/MyModule-${{ steps.package.outputs.version }}-darwin.tar.gz"
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
7627
release-windows:
77-
runs-on: windows-2016
28+
uses: Geode-solutions/actions/.github/workflows/cd-windows.yml@master
29+
with:
30+
name: OPENGEODE_MYMODULE
31+
repos: OpenGeode
32+
secrets:
33+
TOKEN: ${{ secrets.TOKEN }}
34+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
7835

79-
steps:
80-
- uses: actions/checkout@v1
81-
- uses: Geode-solutions/actions/get-release@master
82-
id: opengeode
83-
with:
84-
repository: OpenGeode
85-
file: '-win64.zip'
86-
token: ${{ secrets.TOKEN }}
87-
- name: Generate package
88-
id: package
89-
run: |
90-
mkdir -p build
91-
cd build
92-
version="${GITHUB_REF##*/*/}"
93-
echo ::set-output name=version::$version
94-
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} -DMYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$version -DCPACK_SYSTEM_NAME:STRING=win64 ..
95-
cmake --build . --config Release
96-
cmake --build . --target PACKAGE --config Release
97-
shell: bash
98-
- name: Upload
99-
uses: softprops/action-gh-release@v1
100-
with:
101-
files: "build/MyModule-${{ steps.package.outputs.version }}-win64.zip"
102-
env:
103-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
release-windows-python:
37+
uses: Geode-solutions/actions/.github/workflows/cd-windows-python.yml@master
38+
with:
39+
name: OPENGEODE_MYMODULE
40+
repos: OpenGeode
41+
secrets:
42+
TOKEN: ${{ secrets.TOKEN }}
43+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
44+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

.github/workflows/CI.yml

Lines changed: 35 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -8,159 +8,49 @@ on:
88

99
jobs:
1010
format:
11-
runs-on: ubuntu-18.04
12-
13-
steps:
14-
- uses: actions/checkout@v1
15-
- uses: Geode-solutions/actions/clang-format@master
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.TOKEN }}
11+
uses: Geode-solutions/actions/.github/workflows/format.yml@master
12+
secrets:
13+
TOKEN: ${{ secrets.TOKEN }}
1814

1915
build-linux:
20-
runs-on: ubuntu-18.04
21-
container: ${{ matrix.config.container }}
2216
needs: format
23-
strategy:
24-
matrix:
25-
config:
26-
- {container: "geodesolutions/ubuntu", cmake_args: "-DCMAKE_BUILD_TYPE=Debug", system: ubuntu}
27-
- {container: "geodesolutions/ubuntu", cmake_args: "-DCMAKE_BUILD_TYPE=Release -DUSE_BENCHMARK=ON", system: ubuntu}
28-
- {container: "geodesolutions/centos", cmake_args: "-DCMAKE_BUILD_TYPE=Debug", system: rhel}
29-
- {container: "geodesolutions/centos", cmake_args: "-DCMAKE_BUILD_TYPE=Release", system: rhel}
30-
31-
32-
steps:
33-
- uses: actions/checkout@v1
34-
- uses: Geode-solutions/actions/get-release@master
35-
id: opengeode
36-
with:
37-
repository: OpenGeode
38-
file: '-${{ matrix.config.system }}.tar.gz'
39-
token: ${{ secrets.TOKEN }}
40-
- name: Compile
41-
run: |
42-
mkdir -p build
43-
cd build
44-
cmake ${{ matrix.config.cmake_args }} -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
45-
cmake --build . -- -j2
46-
- name: Test
47-
run: |
48-
mkdir -p test
49-
cd test
50-
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH="$GITHUB_WORKSPACE/build;$GITHUB_WORKSPACE/${{ steps.opengeode.outputs.path }}" ../tests
51-
cmake --build . -- -j2
52-
ctest --output-on-failure
53-
- name: Notify slack
54-
if: failure() && github.ref == 'refs/heads/master'
55-
uses: 8398a7/action-slack@v2
56-
with:
57-
status: failure
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
61-
62-
coverage:
63-
runs-on: ubuntu-18.04
17+
uses: Geode-solutions/actions/.github/workflows/ci-linux.yml@master
18+
with:
19+
repos: OpenGeode
20+
secrets:
21+
TOKEN: ${{ secrets.TOKEN }}
22+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
23+
24+
build-linux-python:
6425
needs: format
65-
if: (github.event_name == 'pull_request' || github.ref == 'refs/heads/master')
66-
26+
uses: Geode-solutions/actions/.github/workflows/ci-linux-python.yml@master
27+
with:
28+
name: OPENGEODE_MYMODULE
29+
repos: OpenGeode
30+
secrets:
31+
TOKEN: ${{ secrets.TOKEN }}
32+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
6733

68-
steps:
69-
- uses: actions/checkout@v1
70-
- uses: Geode-solutions/actions/get-release@master
71-
id: opengeode
72-
with:
73-
repository: OpenGeode
74-
file: '-ubuntu.tar.gz'
75-
token: ${{ secrets.TOKEN }}
76-
- name: Compile
77-
run: |
78-
mkdir -p build
79-
cd build
80-
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
81-
cmake --build . -- -j2
82-
- name: Kcov
83-
run: curl -s https://raw.githubusercontent.com/Geode-solutions/actions/master/kcov.sh | bash -s -- ${GITHUB_WORKSPACE}/build/bin
84-
- uses: codecov/[email protected]
85-
with:
86-
token: ${{ secrets.CODECOV_TOKEN }}
87-
file: kcov/kcov-merged/cobertura.xml
88-
- name: Notify slack
89-
if: failure() && github.ref == 'refs/heads/master'
90-
uses: 8398a7/action-slack@v2
91-
with:
92-
status: failure
93-
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
96-
97-
build-mac-xcode:
98-
runs-on: macOS-10.14
34+
coverage:
9935
needs: format
100-
strategy:
101-
matrix:
102-
config: [Debug, Release]
103-
104-
steps:
105-
- uses: actions/checkout@v1
106-
- uses: Geode-solutions/actions/get-release@master
107-
id: opengeode
108-
with:
109-
repository: OpenGeode
110-
file: '-darwin.tar.gz'
111-
token: ${{ secrets.TOKEN }}
112-
- name: Compile & Test
113-
run: |
114-
mkdir -p build
115-
cd build
116-
cmake -G "Xcode" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
117-
cmake --build . --config ${{ matrix.config }}
118-
ctest -C ${{ matrix.config }} --output-on-failure
119-
- name: Notify slack
120-
if: failure() && github.ref == 'refs/heads/master'
121-
uses: 8398a7/action-slack@v2
122-
with:
123-
status: failure
124-
env:
125-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
36+
uses: Geode-solutions/actions/.github/workflows/coverage.yml@master
37+
with:
38+
repos: OpenGeode
39+
secrets:
40+
TOKEN: ${{ secrets.TOKEN }}
12741

12842
build-windows:
129-
runs-on: windows-2016
13043
needs: format
131-
strategy:
132-
matrix:
133-
config: [Debug, Release]
134-
135-
steps:
136-
- uses: actions/checkout@v1
137-
- uses: Geode-solutions/actions/get-release@master
138-
id: opengeode
139-
with:
140-
repository: OpenGeode
141-
file: '-win64.zip'
142-
token: ${{ secrets.TOKEN }}
143-
- name: Compile & Test
144-
run: |
145-
mkdir -p build
146-
cd build
147-
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
148-
cmake --build . --config ${{ matrix.config }}
149-
ctest -C ${{ matrix.config }} --output-on-failure
150-
- name: Notify slack
151-
if: failure() && github.ref == 'refs/heads/master'
152-
uses: 8398a7/action-slack@v2
153-
with:
154-
status: failure
155-
env:
156-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
44+
uses: Geode-solutions/actions/.github/workflows/ci-windows.yml@master
45+
with:
46+
name: OPENGEODE_MYMODULE
47+
repos: OpenGeode
48+
secrets:
49+
TOKEN: ${{ secrets.TOKEN }}
50+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
15851

15952
semantic-release:
160-
runs-on: ubuntu-18.04
161-
needs: [build-linux, coverage, build-mac-xcode, build-windows]
162-
steps:
163-
- uses: actions/checkout@v1
164-
- run: npx semantic-release
165-
env:
166-
GITHUB_TOKEN: ${{ secrets.TOKEN }}
53+
needs: [build-linux, build-linux-python, build-windows]
54+
uses: Geode-solutions/actions/.github/workflows/release.yml@master
55+
secrets:
56+
TOKEN: ${{ secrets.TOKEN }}

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019 - 2021 Geode-solutions
1+
# Copyright (c) 2019 - 2022 Geode-solutions
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to deal
@@ -18,12 +18,13 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
cmake_minimum_required(VERSION 3.11)
21+
cmake_minimum_required(VERSION 3.14)
2222

2323
# Define the project
24-
project(MyModule CXX)
24+
project(OpenGeode-MyModule CXX)
2525

26-
option(MYMODULE_WITH_TESTS "Compile test projects" ON)
26+
option(OPENGEODE_MYMODULE_WITH_TESTS "Compile test projects" ON)
27+
option(OPENGEODE_MYMODULE_WITH_PYTHON "Compile Python bindings" OFF)
2728

2829
# Get MyModule dependencies
2930
find_package(OpenGeode REQUIRED)
@@ -44,13 +45,18 @@ add_geode_library(
4445

4546
#------------------------------------------------------------------------------------------------
4647
# Optional modules configuration
47-
if(MYMODULE_WITH_TESTS)
48+
if(OPENGEODE_MYMODULE_WITH_TESTS)
4849
# Enable testing with CTest
4950
enable_testing()
50-
message(STATUS "Configuring MyModule with tests")
51+
message(STATUS "Configuring OpenGeode-MyModule with tests")
5152
add_subdirectory(tests)
5253
endif()
5354

55+
if(OPENGEODE_MYMODULE_WITH_PYTHON)
56+
message(STATUS "Configuring OpenGeode-MyModule with Python bindings")
57+
add_subdirectory(bindings/python)
58+
endif()
59+
5460
#------------------------------------------------------------------------------------------------
5561
# Configure CPacks
5662
if(WIN32)

COPYLEFT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Dependencies
22

33
OpenGeode: MIT
4-
Copyright (c) 2019 - 2021 Geode-solutions
4+
Copyright (c) 2019 - 2022 Geode-solutions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 - 2021 Geode-solutions
3+
Copyright (c) 2019 - 2022 Geode-solutions
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ For questions and support please use the official [slack](https://slackin-openge
4949

5050
[MIT](https://opensource.org/licenses/MIT)
5151

52-
Copyright (c) 2019 - 2021, Geode-solutions
52+
Copyright (c) 2019 - 2022, Geode-solutions

0 commit comments

Comments
 (0)