-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce github action for ci test asan
- test asan on github action - format check on github action - other test on circleci Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
- Loading branch information
Showing
7 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Asan Build & Test Parallel | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
clang-format-check: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Clang format | ||
run: sudo apt-get install clang-format | ||
- name: Run Clang format check | ||
run: ./scripts/check_format.sh | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
container: | ||
image: vsaglib/vsag:ubuntu | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Load Cache | ||
uses: actions/cache@v4.1.2 | ||
with: | ||
path: ./build/ | ||
key: build-${{ hashFiles('./CMakeLists.txt') }}-${{ hashFiles('./.circleci/fresh_ci_cache.commit') }} | ||
- name: Make Asan | ||
run: make asan | ||
- name: Save Cache | ||
uses: actions/cache@v4.1.2 | ||
with: | ||
path: ./build/ | ||
key: build-${{ hashFiles('./CMakeLists.txt') }}-${{ hashFiles('./.circleci/fresh_ci_cache.commit') }} | ||
- name: Test | ||
run: make test_asan_parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOT_DIR="${SCRIPTS_DIR}/../../" | ||
|
||
COVERAGE_DIR="${ROOT_DIR}/testresult/coverage" | ||
if [ -d "${COVERAGE_DIR}" ]; then | ||
rm -rf "${COVERAGE_DIR:?}"/* | ||
else | ||
mkdir -p "${COVERAGE_DIR}" | ||
fi | ||
|
||
lcov --gcov-tool ${SCRIPTS_DIR}/gcov_for_clang.sh \ | ||
--rc branch_coverage=1 \ | ||
--rc geninfo_unexecuted_blocks=1 \ | ||
--parallel 8 \ | ||
--include "*/vsag/include/*" \ | ||
--include "*/vsag/src/*" \ | ||
--exclude "*/vsag/include/vsag/expected.hpp*" \ | ||
--exclude "*_test.cpp" \ | ||
--capture \ | ||
--ignore-errors mismatch,mismatch \ | ||
--ignore-errors unused,unused \ | ||
--ignore-errors inconsistent,inconsistent \ | ||
--directory . \ | ||
--output-file "${COVERAGE_DIR}/coverage_ut.info" | ||
|
||
pushd "${COVERAGE_DIR}" | ||
coverages=$(ls coverage_*.info) | ||
if [ ! "$coverages" ];then | ||
echo "no coverage file" | ||
exit 0 | ||
fi | ||
lcov_command="lcov" | ||
for coverage in $coverages; do | ||
echo "$coverage" | ||
lcov_command="$lcov_command -a $coverage" | ||
done | ||
$lcov_command -o coverage.info \ | ||
--rc branch_coverage=1 \ | ||
--ignore-errors inconsistent,inconsistent \ | ||
--ignore-errors corrupt,corrupt | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
exec llvm-cov gcov "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters