Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #68

Merged
merged 17 commits into from
Apr 15, 2021
38 changes: 19 additions & 19 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Language: Cpp
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
Expand All @@ -20,7 +20,7 @@ BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
BinPackArguments: true
ColumnLimit: 120
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
DerivePointerAlignment: false
Expand All @@ -43,31 +43,31 @@ PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 2
TabWidth: 2
UseTab: Never
Standard: Cpp11
IndentWidth: 2
TabWidth: 2
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
DisableFormat: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '<[[:alnum:].]+>'
Priority: 4
- Regex: '.*'
Priority: 1
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '<[[:alnum:].]+>'
Priority: 4
- Regex: '.*'
Priority: 1
151 changes: 122 additions & 29 deletions .github/workflows/basic-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,106 @@ on:
env:
CXX: clang++-10
CC: clang-10
EXTERNAL_LIT: /usr/lib/llvm-10/build/utils/lit/lit.py
OMP_NUM_THREAD: 2

jobs:
build-and-run-test:
format-check:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Format source code
run: |
find demo lib test \
-type f \
-a \( -name "*.c" -o -name "*.cpp" -o -name "*.h" \) \
-not -path "*/lulesh/*" \
-print0 \
| xargs -0 clang-format-10 -i

- name: List newly formatted files
run: git status --porcelain --untracked-files=no

- name: Check format
run: git status --porcelain --untracked-files=no | xargs -o -I {} test -z \"{}\"

lit-suite:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
config:
- {
name: Thread-safe-safeptr,
build_type: Debug,
safe_ptr: true,
tsan: true,
}
- {
name: Thread-safe,
build_type: Debug,
safe_ptr: false,
tsan: true,
}
- {
name: Thread-unsafe,
build_type: Debug,
thread_unsafe: true,
tsan: false,
}
- {
name: Coverage-thread-safe-safeptr,
build_type: Debug,
safe_ptr: true,
coverage: true,
tsan: false,
}
- {
name: Coverage-thread-safe,
build_type: Debug,
safe_ptr: false,
coverage: true,
tsan: false,
}
- {
name: Coverage-thread-unsafe,
build_type: Debug,
thread_unsafe: true,
coverage: true,
tsan: false,
}
- {
name: Thread-safe-libc++,
build_type: Debug,
cxxflags: -stdlib=libc++,
skip_test: true,
tsan: true,
}

steps:
- uses: actions/checkout@v2

- name: Install LLVM
run: sudo apt-get install libllvm10 llvm-10 llvm-10-dev

- name: Install LLVM OpenMP runtime
run: sudo apt-get install libomp-10-dev libomp5-10

- name: Install Clang
run: sudo apt-get install clang-10 clang-tidy-10

- name: Install libc++
if: contains(matrix.config.cxxflags, '-stdlib=libc++')
run: sudo apt-get install --no-install-recommends libc++-10-dev libc++abi-10-dev

- name: Install OpenMPI
run: sudo apt-get install libopenmpi-dev openmpi-bin

- name: Install lcov
if: matrix.config.coverage
run: sudo apt-get install lcov

- name: Setup env
Expand All @@ -36,53 +118,64 @@ jobs:
sudo ln -f -s /usr/bin/FileCheck-10 /usr/bin/FileCheck
sudo ln -f -s /usr/bin/llc-10 /usr/bin/llc
sudo ln -f -s /usr/bin/clang-tidy-10 /usr/bin/clang-tidy
echo "EXTERNAL_LIT=/usr/lib/llvm-10/build/utils/lit/lit.py" >> $GITHUB_ENV

- name: Configure TypeART
run: |
cmake -B build \
-DTEST_CONFIG=ON \
-DENABLE_CODE_COVERAGE=ON \
-DSOFTCOUNTERS=ON \
-DLLVM_EXTERNAL_LIT=${EXTERNAL_LIT}
-DTEST_CONFIG=ON -DSOFTCOUNTERS=ON \
-DENABLE_CODE_COVERAGE=${{ matrix.config.coverage }} \
-DENABLE_TSAN=${{ matrix.config.tsan }} \
-DENABLE_ASAN=${{ matrix.config.tsan == false }} \
-DENABLE_UBSAN=${{ matrix.config.tsan == false }} \
-DENABLE_SAFEPTR=${{ matrix.config.safe_ptr }} \
-DDISABLE_THREAD_SAFETY=${{ matrix.config.thread_unsafe }} \
-DLLVM_EXTERNAL_LIT=${EXTERNAL_LIT} \
-DCMAKE_CXX_FLAGS="${{ matrix.config.cxxflags }}" \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}

- name: Build TypeART
run: cmake --build build --parallel 2

- name: Test TypeART with coverage
run: |
cmake --build build --target lcov-clean
cmake --build build --target test -- ARGS=-VV
- name: Prepare TypeART coverage
if: matrix.config.coverage
run: cmake --build build --target lcov-clean

- name: Test TypeART lit-suite
if: matrix.config.skip_test == false
run: cmake --build build --target lit-pass-test

- name: Build coverage report
if: matrix.config.coverage
run: cmake --build build --target lcov-html

- name: Build TypeART release
- name: Prepare coverage artifact
if: matrix.config.coverage
run: |
cmake -B build_lulesh -DCMAKE_BUILD_TYPE=Release -DMPI_INTERCEPT_LIB=ON -DSHOW_STATS=ON -DSOFTCOUNTERS=ON
cmake --build build_lulesh --parallel
mkdir -p artifact/${{ matrix.config.name }}
mv build/profiles/ artifact/${{ matrix.config.name }}

- name: Test TypeART release on lulesh
working-directory: build_lulesh
run: ctest -V -R lulesh -O lulesh2.0_build.log

- name: Prepare artifact
run: |
mkdir -p artifact/lulesh
mkdir -p artifact/coverage
mv build_lulesh/lulesh2.0_build.log artifact/lulesh/
mv test/lulesh/lulesh2.0_out.log artifact/lulesh/
mv test/lulesh/types.yaml artifact/lulesh/lulesh2.0_types.yaml
mv build/profiles/ artifact/coverage

- name: Upload lulesh test artifact
- name: Upload test coverage artifact
if: matrix.config.coverage
uses: actions/upload-artifact@v2
with:
name: typeart-ci
name: typeart-ci-coverage
path: artifact

- name: Coveralls
- name: Coveralls (parallel)
if: matrix.config.coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: build/typeart.coverage
flag-name: ${{ matrix.config.name }}
parallel: true

finish-coverage:
needs: lit-suite
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
Loading