Skip to content

Commit db2bf36

Browse files
authored
trying to add a git workflow (#829)
* Adding support for github actions
1 parent b1bc4d0 commit db2bf36

File tree

2 files changed

+153
-11
lines changed

2 files changed

+153
-11
lines changed

.clang-format

+76-11
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
Language: Cpp
33
AccessModifierOffset: -4
44
AlignAfterOpenBracket: Align
5-
AlignConsecutiveMacros: false
6-
AlignConsecutiveAssignments: true
7-
AlignConsecutiveDeclarations: false
5+
AlignArrayOfStructures: None
6+
AlignConsecutiveMacros: Consecutive
7+
AlignConsecutiveAssignments: Consecutive
8+
AlignConsecutiveBitFields: None
9+
AlignConsecutiveDeclarations: None
810
AlignEscapedNewlines: Left
9-
AlignOperands: true
11+
AlignOperands: Align
1012
AlignTrailingComments: true
1113
AllowAllArgumentsOnNextLine: true
12-
AllowAllConstructorInitializersOnNextLine: true
1314
AllowAllParametersOfDeclarationOnNextLine: true
14-
AllowShortBlocksOnASingleLine: false
15+
AllowShortEnumsOnASingleLine: true
16+
AllowShortBlocksOnASingleLine: Never
1517
AllowShortCaseLabelsOnASingleLine: false
1618
AllowShortFunctionsOnASingleLine: InlineOnly
1719
AllowShortLambdasOnASingleLine: All
@@ -21,12 +23,14 @@ AlwaysBreakAfterDefinitionReturnType: None
2123
AlwaysBreakAfterReturnType: None
2224
AlwaysBreakBeforeMultilineStrings: false
2325
AlwaysBreakTemplateDeclarations: Yes
26+
AttributeMacros:
27+
- __capability
2428
BinPackArguments: true
2529
BinPackParameters: true
2630
BraceWrapping:
2731
AfterCaseLabel: false
2832
AfterClass: false
29-
AfterControlStatement: false
33+
AfterControlStatement: Never
3034
AfterEnum: false
3135
AfterFunction: false
3236
AfterNamespace: false
@@ -36,11 +40,14 @@ BraceWrapping:
3640
AfterExternBlock: false
3741
BeforeCatch: false
3842
BeforeElse: false
43+
BeforeLambdaBody: false
44+
BeforeWhile: false
3945
IndentBraces: false
4046
SplitEmptyFunction: true
4147
SplitEmptyRecord: true
4248
SplitEmptyNamespace: true
4349
BreakBeforeBinaryOperators: None
50+
BreakBeforeConceptDeclarations: true
4451
BreakBeforeBraces: Attach
4552
BreakBeforeInheritanceComma: false
4653
BreakInheritanceList: BeforeColon
@@ -51,76 +58,134 @@ BreakAfterJavaFieldAnnotations: false
5158
BreakStringLiterals: true
5259
ColumnLimit: 0
5360
CommentPragmas: '^ IWYU pragma:'
61+
QualifierAlignment: Leave
5462
CompactNamespaces: false
55-
ConstructorInitializerAllOnOneLineOrOnePerLine: true
5663
ConstructorInitializerIndentWidth: 4
5764
ContinuationIndentWidth: 4
5865
Cpp11BracedListStyle: true
66+
DeriveLineEnding: true
5967
DerivePointerAlignment: false
6068
DisableFormat: false
69+
EmptyLineAfterAccessModifier: Never
70+
EmptyLineBeforeAccessModifier: LogicalBlock
6171
ExperimentalAutoDetectBinPacking: false
72+
PackConstructorInitializers: NextLine
73+
BasedOnStyle: ''
74+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
75+
AllowAllConstructorInitializersOnNextLine: true
6276
FixNamespaceComments: false
6377
ForEachMacros:
6478
- foreach
6579
- Q_FOREACH
6680
- BOOST_FOREACH
81+
IfMacros:
82+
- KJ_IF_MAYBE
6783
IncludeBlocks: Preserve
6884
IncludeCategories:
6985
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
7086
Priority: 2
87+
SortPriority: 0
88+
CaseSensitive: false
7189
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
7290
Priority: 3
91+
SortPriority: 0
92+
CaseSensitive: false
7393
- Regex: '.*'
7494
Priority: 1
95+
SortPriority: 0
96+
CaseSensitive: false
7597
IncludeIsMainRegex: '(Test)?$'
98+
IncludeIsMainSourceRegex: ''
99+
IndentAccessModifiers: false
76100
IndentCaseLabels: false
101+
IndentCaseBlocks: false
102+
IndentGotoLabels: true
77103
IndentPPDirectives: None
104+
IndentExternBlock: AfterExternBlock
105+
IndentRequires: false
78106
IndentWidth: 4
79107
IndentWrappedFunctionNames: false
108+
InsertTrailingCommas: None
80109
JavaScriptQuotes: Leave
81110
JavaScriptWrapImports: true
82111
KeepEmptyLinesAtTheStartOfBlocks: true
112+
LambdaBodyIndentation: Signature
83113
MacroBlockBegin: ''
84114
MacroBlockEnd: ''
85115
MaxEmptyLinesToKeep: 1
86116
NamespaceIndentation: None
87117
ObjCBinPackProtocolList: Auto
88118
ObjCBlockIndentWidth: 2
119+
ObjCBreakBeforeNestedBlockParam: true
89120
ObjCSpaceAfterProperty: false
90121
ObjCSpaceBeforeProtocolList: true
91122
PenaltyBreakAssignment: 2
92123
PenaltyBreakBeforeFirstCallParameter: 19
93124
PenaltyBreakComment: 300
94125
PenaltyBreakFirstLessLess: 120
126+
PenaltyBreakOpenParenthesis: 0
95127
PenaltyBreakString: 1000
96128
PenaltyBreakTemplateDeclaration: 10
97129
PenaltyExcessCharacter: 1000000
98130
PenaltyReturnTypeOnItsOwnLine: 60
131+
PenaltyIndentedWhitespace: 0
99132
PointerAlignment: Right
133+
PPIndentWidth: -1
134+
ReferenceAlignment: Pointer
100135
ReflowComments: true
101-
SortIncludes: true
136+
RemoveBracesLLVM: false
137+
SeparateDefinitionBlocks: Leave
138+
ShortNamespaceLines: 1
139+
SortIncludes: CaseSensitive
140+
SortJavaStaticImport: Before
102141
SortUsingDeclarations: true
103142
SpaceAfterCStyleCast: false
104143
SpaceAfterLogicalNot: false
105144
SpaceAfterTemplateKeyword: true
106145
SpaceBeforeAssignmentOperators: true
146+
SpaceBeforeCaseColon: false
107147
SpaceBeforeCpp11BracedList: false
108148
SpaceBeforeCtorInitializerColon: true
109149
SpaceBeforeInheritanceColon: true
110150
SpaceBeforeParens: ControlStatements
151+
SpaceBeforeParensOptions:
152+
AfterControlStatements: true
153+
AfterForeachMacros: true
154+
AfterFunctionDefinitionName: false
155+
AfterFunctionDeclarationName: false
156+
AfterIfMacros: true
157+
AfterOverloadedOperator: false
158+
BeforeNonEmptyParentheses: false
159+
SpaceAroundPointerQualifiers: Default
111160
SpaceBeforeRangeBasedForLoopColon: true
161+
SpaceInEmptyBlock: false
112162
SpaceInEmptyParentheses: false
113163
SpacesBeforeTrailingComments: 1
114-
SpacesInAngles: false
164+
SpacesInAngles: Never
165+
SpacesInConditionalStatement: false
115166
SpacesInContainerLiterals: true
116167
SpacesInCStyleCastParentheses: false
168+
SpacesInLineCommentPrefix:
169+
Minimum: 1
170+
Maximum: -1
117171
SpacesInParentheses: false
118172
SpacesInSquareBrackets: false
119-
Standard: Cpp11
173+
SpaceBeforeSquareBrackets: false
174+
BitFieldColonSpacing: Both
175+
Standard: Latest
176+
StatementAttributeLikeMacros:
177+
- Q_EMIT
120178
StatementMacros:
121179
- Q_UNUSED
122180
- QT_REQUIRE_VERSION
123181
TabWidth: 4
182+
UseCRLF: false
124183
UseTab: ForContinuationAndIndentation
184+
WhitespaceSensitiveMacros:
185+
- STRINGIZE
186+
- PP_STRINGIZE
187+
- BOOST_PP_STRINGIZE
188+
- NS_SWIFT_NAME
189+
- CF_SWIFT_NAME
125190
...
126191

.github/workflows/build.yaml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
BUILD_TYPE: Debug
12+
13+
jobs:
14+
build_ubuntu_20:
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Install Dependencies
18+
run: sudo apt-get install -y libcapstone-dev libgraphviz-dev
19+
20+
- uses: actions/checkout@v2
21+
with:
22+
submodules: true
23+
24+
- name: Install Qt
25+
uses: jurplel/install-qt-action@v3
26+
with:
27+
version: "5.12.8"
28+
29+
- name: Configure CMake
30+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
31+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
32+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
33+
34+
- name: Build
35+
# Build your program with the given configuration
36+
run: cmake --build ${{github.workspace}}/build --parallel 4 --config ${{env.BUILD_TYPE}}
37+
38+
build_ubuntu_18:
39+
runs-on: ubuntu-18.04
40+
steps:
41+
- name: Install Dependencies
42+
run: sudo apt-get install -y libcapstone-dev libgraphviz-dev
43+
44+
- uses: actions/checkout@v2
45+
with:
46+
submodules: true
47+
48+
- name: Install Qt
49+
uses: jurplel/install-qt-action@v3
50+
with:
51+
version: "5.9.5"
52+
53+
- name: Configure CMake
54+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
55+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
56+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
57+
58+
- name: Build
59+
# Build your program with the given configuration
60+
run: cmake --build ${{github.workspace}}/build --parallel 4 --config ${{env.BUILD_TYPE}}
61+
62+
# Disabled until both aqinstall and install-qt-action support the fixes…
63+
# build_windows:
64+
# runs-on: windows-latest
65+
# steps:
66+
# - uses: actions/checkout@v2
67+
# - uses: MasterQ32/install-qt-action@master
68+
# with:
69+
# version: '5.15.0'
70+
# host: 'windows'
71+
# target: 'desktop'
72+
# arch: 'win64_mingw81'
73+
# install-deps: 'true'
74+
# tools: 'tools_openssl_x64 qt.tools.openssl.win_x64;tools_openssl_src qt.tools.openssl'
75+
# - name: build and deploy
76+
# run: ./build-and-deploy.bat
77+
# working-directory: ./ci/

0 commit comments

Comments
 (0)