Skip to content

Commit

Permalink
[INFRA] Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jun 3, 2022
1 parent afd7ff6 commit bedb7cc
Show file tree
Hide file tree
Showing 8 changed files with 687 additions and 95 deletions.
186 changes: 186 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Format all files in include folder, including std module, excluding contrib module
# find . \( -path "./include/seqan3/std/*" -or -iname "*.hpp" \) -and -not -path "./submodules/*" -and -not -path "./build/*" -and -not -path "./include/seqan3/contrib/*" -and -not -path "./test/*" | xargs clang-format-15 --style=file -i
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: AfterColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Custom
QualifierOrder: ['static', 'inline', 'constexpr', 'volatile', 'type', 'const']
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: CurrentLine
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
IfMacros:
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '(<gtest/.*|<benchmark/.*)'
Priority: 1
- Regex: '(<[[:alnum:]._]+>|<seqan3/std/.*>)'
Priority: 2
- Regex: '<sdsl/'
Priority: 3
- Regex: '<seqan3/'
Priority: 4
- Regex: '<cereal/'
Priority: 5
- Regex: '<lemon/'
Priority: 6
- Regex: '.*'
Priority: 7
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentExternBlock: AfterExternBlock
IndentRequiresClause : true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Middle
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: false
RemoveBracesLLVM: false
RequiresClausePosition : OwnLine
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: true
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause : true
AfterRequiresInExpression : true
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: c++20
StatementAttributeLikeMacros:
StatementMacros:
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- SHARG_DEPRECATED_HEADER
...
92 changes: 48 additions & 44 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ name: CI on Linux
on:
push:
branches:
# Push events to branches matching refs/heads/master
- 'master'
# Push events to branches matching refs/heads/release*
- 'release*'
# Trigger after PR was unlabeled
pull_request:
types:
- unlabeled
# Enables a manual trigger, may run on any branch
workflow_dispatch:

concurrency:
group: linux-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -22,46 +30,57 @@ defaults:
jobs:
build:
name: ${{ matrix.name }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 120
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'clang-format'
strategy:
fail-fast: true
matrix:
include:
- name: "Coverage gcc11"
cxx: "g++-11"
cc: "gcc-11"
build_type: Coverage
- name: "Coverage gcc12"
cxx: "g++-12"
cc: "gcc-12"
build: coverage
build_type: Debug

- name: "Unit gcc12"
cxx: "g++-12"
cc: "gcc-12"
build: unit
build_type: Release

- name: "Unit gcc11"
cxx: "g++-11"
cc: "gcc-11"
build: unit
build_type: Release

- name: "Unit gcc10"
cxx: "g++-10"
cc: "gcc-10"
build: unit
build_type: Release

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: sharg
fetch-depth: 2
submodules: recursive

# To reuse scripts
- name: Checkout SeqAn3
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: seqan/seqan3
ref: 383e8f8d638f8a727a79136ce96ae7642befe39f
ref: df3f29a00543f02cc8cb5e05f40ea8057cf36c5d
path: seqan3
fetch-depth: 2
fetch-depth: 1
submodules: false

- name: Add package source
- name: Configure APT
continue-on-error: true
run: bash ./seqan3/.github/workflows/scripts/configure_apt.sh

- name: Install CMake
Expand All @@ -75,16 +94,16 @@ jobs:
- name: Install compiler ${{ matrix.cxx }}
run: sudo apt-get install --yes ${{ matrix.cxx }}

- name: Install lcov
if: matrix.build_type == 'Coverage'
- name: Install gcovr
if: matrix.build == 'coverage'
env:
CC: ${{ matrix.cc }}
run: |
sudo apt-get install --yes lcov
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
pip install gcovr==5.0
- name: Load ccache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .ccache
key: ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }}-${{ github.run_number }}
Expand All @@ -104,11 +123,11 @@ jobs:
CXX: ${{ matrix.cxx }}
CC: ${{ matrix.cc }}
run: |
mkdir build
cd build
cmake ../sharg/test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF
mkdir sharg-build
cd sharg-build
cmake ../sharg/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF
make -j2 gtest_build
- name: Build tests
Expand All @@ -117,39 +136,24 @@ jobs:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 12
CCACHE_MAXSIZE: ${{ matrix.build_type == 'Coverage' && '125M' || '50M' }}
CCACHE_MAXSIZE: ${{ matrix.build != 'coverage' && '125M' || '50M' }}
CCACHE_IGNOREOPTIONS: "-fprofile-abs-path"
GCOV: ${{ github.workspace }}/seqan3/.github/workflows/scripts/gcov.sh
run: |
ccache -z
cd build
cd sharg-build
make -k -j2
ccache -sv
- name: Generate coverage baseline
if: matrix.build_type == 'Coverage'
run: |
lcov --directory ./build/ --zerocounters
lcov --directory ./build/ --capture --initial --output-file ./build/coverage_report.baseline
- name: Run tests
if: matrix.build != 'coverage'
run: |
cd build
cd sharg-build
ctest . -j2 --output-on-failure
- name: Generate coverage report
if: matrix.build_type == 'Coverage'
run: |
lcov --directory ./build/ --capture --output-file ./build/coverage_report.captured
lcov -a ./build/coverage_report.baseline -a ./build/coverage_report.captured --output-file ./build/coverage_report.total
lcov --remove ./build/coverage_report.total \
'/usr/*' \
'${{ github.workspace }}/sharg/lib/*' \
'${{ github.workspace }}/sharg/test/*' \
'${{ github.workspace }}/build/vendor/*' \
--output-file ./build/coverage_report
- name: Submit coverage report
if: matrix.build_type == 'Coverage'
uses: codecov/codecov-action@v1
- name: Submit coverage build
if: matrix.build == 'coverage'
uses: codecov/codecov-action@v2
with:
files: ${{ github.workspace }}/build/coverage_report
files: ${{ github.workspace }}/sharg-build/sharg_coverage.xml
root_dir: ${{ github.workspace }}/sharg
Loading

0 comments on commit bedb7cc

Please sign in to comment.