Skip to content

Commit 47193e1

Browse files
committed
Initial commit
0 parents  commit 47193e1

File tree

19 files changed

+1028
-0
lines changed

19 files changed

+1028
-0
lines changed

.clang-format

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# clang-format configuration file based on the version 3.8
2+
# releases.llvm.org/3.8.0/tools/clang/docs/ClangFormatStyleOptions.html
3+
#BasedOnStyle (desactivated since we want to control everything [BC])
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
# If AlignEscapedNewlinesLeft is false, that put as far right as possible,
9+
# else left. In newer clang-format version,
10+
#use AlignEscapedNewlines: Right instead.
11+
AlignEscapedNewlinesLeft: false
12+
AlignOperands: true
13+
AlignTrailingComments: false
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: true
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortFunctionsOnASingleLine: Empty # pb with 3.5
18+
AllowShortIfStatementsOnASingleLine: false
19+
AllowShortLoopsOnASingleLine: false
20+
#AlwaysBreakAfterDefinitionReturnType (not set because deprecated [BC])
21+
AlwaysBreakAfterReturnType: None
22+
AlwaysBreakBeforeMultilineStrings: false
23+
AlwaysBreakTemplateDeclarations: true
24+
BinPackArguments: true
25+
BinPackParameters: false
26+
BraceWrapping:
27+
AfterClass: true
28+
AfterControlStatement: true
29+
AfterEnum: true
30+
AfterFunction: true
31+
AfterNamespace: true
32+
AfterObjCDeclaration: true
33+
AfterStruct: true
34+
AfterUnion: true
35+
BeforeCatch: true
36+
BeforeElse: true
37+
IndentBraces: false
38+
#SplitEmptyFunctionBody: false (this option provokes a clang-format error [BC])
39+
BreakBeforeBinaryOperators: NonAssignment # pb with 3.5
40+
BreakBeforeBraces: Custom # pb with 3.5
41+
#BreakBeforeInheritanceComma: false (this option needs a newer clang version)
42+
BreakBeforeTernaryOperators: true
43+
# For newer clang version, consider the new macro:
44+
# BreakConstructorInitializers
45+
BreakConstructorInitializersBeforeComma: false
46+
#BreakStringLiterals
47+
ColumnLimit: 80
48+
CommentPragmas: ''
49+
#CompactNamespaces: false (this option is in newer clang version)
50+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
51+
ConstructorInitializerIndentWidth: 4
52+
ContinuationIndentWidth: 4
53+
Cpp11BracedListStyle: false
54+
DerivePointerAlignment: true
55+
DisableFormat: false
56+
#ExperimentalAutoDetectBinPacking (Not defined since the documentation to not use it)
57+
#FixNamespaceComments: false (this option needs a newer clang version)
58+
#ForEachMacros: TODO
59+
#IncludeCategories: TODO
60+
#IncludeIsMainRegex (this option needs a newer clang version)
61+
IndentCaseLabels: false
62+
IndentWidth: 4
63+
IndentWrappedFunctionNames: true
64+
KeepEmptyLinesAtTheStartOfBlocks: false
65+
Language: Cpp
66+
#MacroBlockBegin TODO
67+
#MacroBlockEnd TODO
68+
MaxEmptyLinesToKeep: 1
69+
NamespaceIndentation: All
70+
#PenaltyBreakBeforeFirstCallParameter TODO
71+
#PenaltyBreakComment TODO
72+
#PenaltyBreakFirstLessLess TODO
73+
#PenaltyBreakString TODO
74+
#PenaltyExcessCharacter TODO
75+
#PenaltyReturnTypeOnItsOwnLine TODO
76+
PointerAlignment: Left
77+
ReflowComments: true # TODO check if 3.5 or 3.8
78+
#SortIncludes (this option needs a newer clang version)
79+
#SortUsingDeclarations (this option needs a newer clang version)
80+
SpaceAfterCStyleCast: true
81+
#SpaceAfterTemplateKeyword: false (this option needs a newer clang version)
82+
SpaceBeforeAssignmentOperators: true
83+
SpaceBeforeParens: Never
84+
SpaceInEmptyParentheses: false
85+
SpacesBeforeTrailingComments: 1
86+
SpacesInAngles: true
87+
SpacesInCStyleCastParentheses: false
88+
SpacesInContainerLiterals: false
89+
SpacesInParentheses: true
90+
SpacesInSquareBrackets: false
91+
Standard: Cpp11
92+
TabWidth: 4
93+
UseTab: Never

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/* linguist-vendored

.github/workflows/CD.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags: 'v*'
6+
7+
jobs:
8+
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}
16+
17+
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+
76+
release-windows:
77+
runs-on: windows-2016
78+
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 }}

.github/workflows/CI.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: 0 0 * * *
8+
9+
jobs:
10+
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 }}
18+
19+
build-linux:
20+
runs-on: ubuntu-18.04
21+
container: ${{ matrix.config.container }}
22+
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
64+
needs: format
65+
if: (github.event_name == 'pull_request' || github.ref == 'refs/heads/master')
66+
67+
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
99+
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 }}
127+
128+
build-windows:
129+
runs-on: windows-2016
130+
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 }}
158+
159+
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 }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
.settings

.releaserc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plugins": [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
5+
'@semantic-release/github'
6+
]
7+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"C_Cpp.default.cppStandard": "c++11",
3+
"C_Cpp.default.includePath": [
4+
"${workspaceFolder}/include",
5+
"${workspaceFolder}/build",
6+
"${workspaceFolder:OpenGeode}/build/opengeode/install/include"
7+
],
8+
"files.watcherExclude": {
9+
"${workspaceFolder}/build/**": true
10+
}
11+
}

0 commit comments

Comments
 (0)