Skip to content

Commit 023b7df

Browse files
Merge pull request #5 from NTIA/dev
PropLib Template 1.0
2 parents 4485882 + 2691484 commit 023b7df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3132
-0
lines changed

.clang-format

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# NTIA/ITS C++ Clang-Format Style Options
2+
# Updated 9/25/2024
3+
---
4+
AlignAfterOpenBracket: BlockIndent
5+
AlignOperands: AlignAfterOperator
6+
AlignTrailingComments: true
7+
AllowAllArgumentsOnNextLine: true
8+
AllowAllParametersOfDeclarationOnNextLine: true
9+
AllowShortBlocksOnASingleLine: Never
10+
AllowShortCaseLabelsOnASingleLine: false
11+
AllowShortLambdasOnASingleLine: All
12+
AllowShortEnumsOnASingleLine: false
13+
AllowShortFunctionsOnASingleLine: None
14+
AllowShortIfStatementsOnASingleLine: Never
15+
AllowShortLoopsOnASingleLine: false
16+
AlwaysBreakAfterDefinitionReturnType: None
17+
AlwaysBreakAfterReturnType: None
18+
AlwaysBreakBeforeMultilineStrings: true
19+
AlwaysBreakTemplateDeclarations: Yes
20+
BasedOnStyle: WebKit
21+
BinPackArguments: false
22+
BinPackParameters: false
23+
BitFieldColonSpacing: After
24+
BraceWrapping:
25+
AfterCaseLabel: false
26+
AfterClass: false
27+
AfterControlStatement: false
28+
AfterEnum: false
29+
AfterFunction: false
30+
AfterNamespace: false
31+
AfterObjCDeclaration: false
32+
AfterStruct: false
33+
AfterUnion: false
34+
AfterExternBlock: false
35+
BeforeCatch: false
36+
BeforeElse: false
37+
IndentBraces: false
38+
SplitEmptyFunction: false
39+
SplitEmptyRecord: false
40+
SplitEmptyNamespace: false
41+
BeforeLambdaBody: false
42+
BeforeWhile: false
43+
BreakBeforeBinaryOperators: All
44+
BreakBeforeBraces: Attach
45+
BreakInheritanceList: AfterColon
46+
BreakBeforeConceptDeclarations: false
47+
BreakConstructorInitializers: AfterColon
48+
BreakStringLiterals: true
49+
ColumnLimit: 80
50+
CompactNamespaces: false
51+
ConstructorInitializerIndentWidth: 4
52+
ContinuationIndentWidth: 4
53+
Cpp11BracedListStyle: true
54+
DerivePointerAlignment: false
55+
EmptyLineBeforeAccessModifier: Never
56+
FixNamespaceComments: true
57+
IncludeBlocks: Regroup
58+
IndentAccessModifiers: true
59+
IndentCaseBlocks: true
60+
IndentCaseLabels: true
61+
IndentExternBlock: Indent
62+
IndentGotoLabels: true
63+
IndentPPDirectives: BeforeHash
64+
IndentRequires: true
65+
IndentWidth: 4
66+
IndentWrappedFunctionNames: true
67+
KeepEmptyLinesAtTheStartOfBlocks: false
68+
Language: Cpp
69+
LineEnding: CRLF
70+
MaxEmptyLinesToKeep: 2
71+
NamespaceIndentation: None
72+
ObjCBinPackProtocolList: Never
73+
ObjCBlockIndentWidth: 4
74+
ObjCBreakBeforeNestedBlockParam: true
75+
ObjCSpaceAfterProperty: true
76+
ObjCSpaceBeforeProtocolList: true
77+
PointerAlignment: Right
78+
ReflowComments: false
79+
SortIncludes: true
80+
SortUsingDeclarations: true
81+
SpaceAfterCStyleCast: false
82+
SpaceAfterLogicalNot: false
83+
SpaceAfterTemplateKeyword: false
84+
SpaceAroundPointerQualifiers: Default
85+
SpaceBeforeAssignmentOperators: true
86+
SpaceBeforeCaseColon: false
87+
SpaceBeforeCpp11BracedList: true
88+
SpaceBeforeCtorInitializerColon: false
89+
SpaceBeforeInheritanceColon: false
90+
SpaceBeforeParens: ControlStatements
91+
SpaceBeforeRangeBasedForLoopColon: true
92+
SpaceBeforeSquareBrackets: false
93+
SpaceInEmptyBlock: false
94+
SpaceInEmptyParentheses: false
95+
SpacesBeforeTrailingComments: 2
96+
SpacesInAngles: false
97+
SpacesInContainerLiterals: false
98+
SpacesInConditionalStatement: false
99+
SpacesInParentheses: false
100+
SpacesInSquareBrackets: false
101+
Standard: c++14
102+
TabWidth: 4
103+
UseTab: Never

.github/workflows/cff-validator.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Validate CITATION.cff
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- 'CITATION.cff'
8+
- '.github/workflows/cff-validator.yml'
9+
pull_request:
10+
branches: ["main", "dev"]
11+
paths:
12+
- 'CITATION.cff'
13+
- '.github/workflows/cff-validator.yml'
14+
workflow_dispatch:
15+
16+
jobs:
17+
Validate-CITATION-cff:
18+
runs-on: ubuntu-latest
19+
name: Validate CITATION.cff
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Validate CITATION.cff
27+
uses: dieghernan/cff-validator@v3
28+
with:
29+
install-r: true

.github/workflows/ctest.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This action compiles the library and driver and runs all unit tests using an OS and CMake matrix
2+
name: Unit Tests
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main", "dev"]
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
13+
cancel-in-progress: true
14+
15+
# Define the matrix for different operating systems
16+
jobs:
17+
build-and-test:
18+
name: ${{ matrix.os }} / ${{ matrix.architecture }} / CMake ${{ matrix.cmakeVersion }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os:
23+
- ubuntu-latest
24+
- macos-latest # Apple
25+
- macos-13 # Intel
26+
- windows-latest
27+
architecture: [arm64, x64, x86]
28+
cmakeVersion: ["3.21", latest] # CMake >= 3.21 is required to use "--preset <presetName>" and discover generators
29+
exclude:
30+
- os: macos-latest
31+
architecture: x86
32+
- os: macos-latest
33+
architecture: x64
34+
- os: macos-13
35+
architecture: x86
36+
- os: macos-13
37+
architecture: arm64
38+
- os: windows-latest
39+
architecture: arm64
40+
- os: ubuntu-latest
41+
architecture: arm64
42+
- os: ubuntu-latest
43+
architecture: x86
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Clone required submodules
49+
run: |
50+
git submodule init extern/googletest
51+
git submodule update
52+
53+
- name: Install CMake
54+
uses: lukka/get-cmake@latest
55+
with:
56+
cmakeVersion: ${{ matrix.cmakeVersion }}
57+
58+
- name: "CMake: Build and Test (64-bit)"
59+
if: matrix.architecture != 'x86'
60+
uses: lukka/run-cmake@v10
61+
with:
62+
configurePreset: release64
63+
configurePresetAdditionalArgs: "['-DBUILD_DOCS=OFF']"
64+
buildPreset: release64
65+
testPreset: release64
66+
67+
- name: "CMake: Build and Test (32-bit)"
68+
if: matrix.architecture == 'x86'
69+
uses: lukka/run-cmake@v10
70+
with:
71+
configurePreset: release32
72+
configurePresetAdditionalArgs: "['-DBUILD_DOCS=OFF']"
73+
buildPreset: release32
74+
testPreset: release32

.github/workflows/doxygen.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This action builds **AND DEPLOYS** Doxygen documentation to GitHub Pages
2+
# Doxygen site is DEPLOYED if this action is triggered by publishing a release.
3+
# Doxygen site is NOT DEPLOYED (only built) when triggered by pull request or dispatched.
4+
name: C++ Docs
5+
6+
on:
7+
release:
8+
types: ["published"]
9+
pull_request:
10+
branches: ["main", "dev"]
11+
push:
12+
branches: ["main"]
13+
workflow_dispatch:
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Clone doxygen-awesome-css submodule
29+
run: |
30+
git submodule init extern/doxygen-awesome-css
31+
git submodule update
32+
33+
- name: Install Doxygen
34+
uses: ssciwr/doxygen-install@v1
35+
with:
36+
version: "1.12.0"
37+
38+
- name: Setup GitHub Pages
39+
if: ${{ github.event_name == 'release' }}
40+
id: pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Install CMake
44+
uses: lukka/get-cmake@latest
45+
46+
- name: Build documentation with Doxygen
47+
uses: lukka/run-cmake@v10
48+
with:
49+
configurePreset: docsOnly
50+
buildPreset: docsOnly
51+
52+
- name: Upload GitHub Pages artifact
53+
uses: actions/upload-pages-artifact@v3
54+
if: ${{ github.event_name == 'release' }}
55+
with:
56+
path: ./docs/html/
57+
58+
deploy:
59+
if: ${{ github.event_name == 'release' }}
60+
needs: build
61+
permissions:
62+
contents: read
63+
pages: write
64+
id-token: write
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# This action compiles multi-platform binaries for a release.
2+
# It is triggered when a new tag is made with a version number starting with "v"
3+
name: Create Release Artifacts
4+
5+
on:
6+
push:
7+
tags: ['v[0-9]+.*']
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
create_release_artifacts:
15+
name: 'Create Release: ${{ matrix.relName}}'
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
include:
20+
- os: windows-latest
21+
architecture: x64
22+
relName: Windows x64
23+
- os: windows-latest
24+
architecture: x86
25+
relName: Windows x86
26+
- os: macos-latest
27+
architecture: arm64
28+
relName: macOS Universal
29+
- os: ubuntu-latest
30+
architecture: x64
31+
relName: Linux x64
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Install CMake # (latest stable version)
37+
uses: lukka/get-cmake@latest
38+
39+
- name: "CMake: Build (64-bit)"
40+
if: matrix.architecture != 'x86'
41+
uses: lukka/run-cmake@v10
42+
with:
43+
configurePreset: release64
44+
configurePresetAdditionalArgs: "['-DBUILD_DOCS=OFF', '-DRUN_TESTS=OFF', '-DRUN_DRIVER_TESTS=OFF']"
45+
buildPreset: release64
46+
47+
- name: "CMake: Build (32-bit)"
48+
if: matrix.architecture == 'x86'
49+
uses: lukka/run-cmake@v10
50+
with:
51+
configurePreset: release32
52+
configurePresetAdditionalArgs: "['-DBUILD_DOCS=OFF', '-DRUN_TESTS=OFF', '-DRUN_DRIVER_TESTS=OFF', '-A', 'Win32']"
53+
buildPreset: release32
54+
55+
- name: Upload release artifacts (binaries)
56+
if: runner.os != 'Windows'
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: "${{ github.event.repository.name }}-release-${{ runner.os }}"
60+
path: |
61+
${{ github.workspace }}/bin/*-universal.dylib
62+
${{ github.workspace }}/bin/*-x86_64.so
63+
${{ github.workspace }}/bin/*Driver*-*-Darwin-universal
64+
${{ github.workspace }}/bin/*Driver*-*-Linux-x86_64
65+
if-no-files-found: error
66+
overwrite: true
67+
68+
- name: Upload release artifact (Windows)
69+
if: runner.os == 'Windows'
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: "${{ github.event.repository.name }}-release-${{ runner.os }}-${{ matrix.architecture }}"
73+
path: |
74+
${{ github.workspace }}\bin\Release\*.dll
75+
${{ github.workspace }}\bin\Release\*Driver-*.exe
76+
if-no-files-found: error
77+
overwrite: true
78+
79+
- name: Upload release artifact (C++ Header) # TODO-TEMPLATE: Specify the correct header below
80+
if: runner.os == 'Linux'
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: "${{ github.event.repository.name }}-release-cpp-header"
84+
path: ${{ github.workspace }}/include/PropLibTemplate.h
85+
if-no-files-found: error
86+
overwrite: true

0 commit comments

Comments
 (0)