Skip to content

Commit

Permalink
ci: conditionally run asan/tsan based on context (#1395)
Browse files Browse the repository at this point in the history
Description: Sanitization checks constitute our two slowest current CI jobs. Updates these checks to automatically pass for PRs that contain no changes to //library/common. Checks will always run after a merge to main.
Risk Level: Low
Testing: CI

Signed-off-by: Mike Schore <[email protected]>
  • Loading branch information
goaway authored Apr 20, 2021
1 parent faaeb52 commit 6abf576
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,16 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
- id: check_context
name: 'Check whether to run'
run: |
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git diff --name-only origin/main | grep -q common/ ; then
echo "Tests will run."
echo "::set-output name=run_tests::true"
else
echo "Skipping tests."
echo "::set-output name=run_tests::false"
fi
- name: 'Run tests'
if: steps.check_context.outputs.run_tests == 'true'
run: bazel test --config=clang-asan --test_output=all --test_env=ENVOY_IP_TEST_VERSIONS=v4only //test/common/...
12 changes: 11 additions & 1 deletion .github/workflows/tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
- run: echo $PATH
- id: check_context
name: 'Check whether to run'
run: |
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git diff --name-only origin/main | grep -q common/ ; then
echo "Tests will run."
echo "::set-output name=run_tests::true"
else
echo "Skipping tests."
echo "::set-output name=run_tests::false"
fi
- name: 'Run tests'
if: steps.check_context.outputs.run_tests == 'true'
run: bazel test --config=clang-tsan --test_output=all --test_env=ENVOY_IP_TEST_VERSIONS=v4only //test/common/...

0 comments on commit 6abf576

Please sign in to comment.