Skip to content

Commit

Permalink
DRY for linux-sanitizer jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sirknightj committed Jan 27, 2025
1 parent 21954bf commit a8acd3c
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 137 deletions.
183 changes: 47 additions & 136 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
env:
CC: gcc-14
CXX: g++-14
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
steps:
- name: Clone repository
uses: actions/checkout@v3
Expand All @@ -57,7 +57,7 @@ jobs:
mac-os-build-clang:
runs-on: macos-13
env:
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
mac-os-m1-build-clang:
runs-on: macos-latest
env:
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
env:
CC: gcc-13
CXX: g++-13
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
env:
CC: gcc-14
CXX: g++-14
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
LDFLAGS: -L/usr/local/opt/openssl@3/lib
CPPFLAGS: -I/usr/local/opt/openssl@3/include
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3/
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
mac-os-build-clang-local-openssl:
runs-on: macos-13
env:
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
LDFLAGS: -L/usr/local/opt/openssl@3/lib
CPPFLAGS: -I/usr/local/opt/openssl@3/include
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3/
Expand Down Expand Up @@ -209,19 +209,26 @@ jobs:
linux-gcc-code-coverage:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
env:
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
DEBIAN_FRONTEND: noninteractive
permissions:
id-token: write
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install dependenices
run: |
apt-get update
apt-get install -y git build-essential automake pkg-config cmake gcovr ggcov lcov
- name: Build repository
run: |
mkdir build && cd build
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DBUILD_COMMON_LWS=TRUE
make
make -j$(nproc)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -232,150 +239,37 @@ jobs:
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
timeout --signal=SIGABRT 150m ./tst/producer_test
- name: Code coverage
run: |
cd build
for test_file in $(find cproducer.dir kvsCommonCurl.dir kvsCommonLws.dir -name '*.gcno'); do gcov $test_file; done
bash <(curl -s https://codecov.io/bash)
address-sanitizer:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
CC: clang
CXX: clang++
AWS_KVS_LOG_LEVEL: 2
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Build repository
run: |
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
make
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 10800
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
undefined-behavior-sanitizer:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
CC: clang
CXX: clang++
AWS_KVS_LOG_LEVEL: 2
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Build repository
run: |
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
make
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 10800
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
# memory-sanitizer:
# runs-on: ubuntu-20.04
# permissions:
# id-token: write
# contents: read
# env:
# CC: clang
# CXX: clang++
# AWS_KVS_LOG_LEVEL: 2
# steps:
# - name: Clone repository
# uses: actions/checkout@v3
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Build repository
# run: |
# mkdir build && cd build
# cmake .. -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
# make
# ulimit -c unlimited -S
# timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure

# thread-sanitizer:
# runs-on: ubuntu-20.04
# permissions:
# id-token: write
# contents: read
# env:
# CC: clang
# CXX: clang++
# AWS_KVS_LOG_LEVEL: 2
# steps:
# - name: Clone repository
# uses: actions/checkout@v3
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Build repository
# run: |
# mkdir build && cd build
# cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
# make
# - name: Run tests
# run: |
# cd build
# ulimit -c unlimited -S
# timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure

ubuntu-gcc:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
env:
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
CC: gcc
CXX: g++
DEBIAN_FRONTEND: noninteractive
permissions:
id-token: write
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt clean && sudo apt update
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
apt-get update
apt-get install -y git build-essential automake pkg-config cmake
- name: Build repository
run: |
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE
make
cmake .. -DBUILD_TEST=ON
make -j$(nproc)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -386,13 +280,12 @@ jobs:
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
timeout --signal=SIGABRT 150m ./tst/producer_test
windows-msvc:
runs-on: windows-2022
env:
AWS_KVS_LOG_LEVEL: 2
AWS_KVS_LOG_LEVEL: 7
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -479,23 +372,41 @@ jobs:
linux-build-gcc-static:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
env:
DEBIAN_FRONTEND: noninteractive
AWS_KVS_LOG_LEVEL: 7
steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y git cmake build-essential automake pkg-config
- name: Build Repository
run: |
mkdir build && cd build
cmake .. -DBUILD_STATIC=ON
make
make -j$(nproc)
linux-thread-size-check:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
env:
DEBIAN_FRONTEND: noninteractive
AWS_KVS_LOG_LEVEL: 7
permissions:
id-token: write
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
apt-get update
apt-get install -y git cmake build-essential automake pkg-config
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/linux-sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Linux sanitizers

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master

jobs:
linux-sanitizers:
strategy:
matrix:
sanitizer:
- ADDRESS_SANITIZER
- UNDEFINED_BEHAVIOR_SANITIZER
# - THREAD_SANITIZER
# - MEMORY_SANITIZER
config:
- name: With Common LWS
cmake_flags: "-DBUILD_TEST=ON -DBUILD_COMMON_LWS=ON"

fail-fast: false

runs-on: ubuntu-latest
container:
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable

timeout-minutes: 80

env:
CC: clang
CXX: clang++
AWS_KVS_LOG_LEVEL: 7
DEBIAN_FRONTEND: noninteractive

permissions:
id-token: write
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
apt-get update
apt-get -y install git build-essential automake pkg-config cmake clang
- name: Build repository - ${{ matrix.config.name }}
run: |
mkdir -p build
cd build
cmake .. -D${{ matrix.sanitizer }}=ON ${{ matrix.config.cmake_flags }}
make -j$(nproc)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 10800

- name: Run tests - ${{ matrix.config.name }}
working-directory: ./build
run: |
timeout --signal=SIGABRT 150m ./tst/producer_test
2 changes: 1 addition & 1 deletion src/source/CurlApiCallbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ STATUS createCurlApiCallbacks(PCallbacksProvider pCallbacksProvider, PCHAR regio
DLOGD("Initializing curl");
CHK(0 == curl_global_init(CURL_GLOBAL_ALL), STATUS_CURL_LIBRARY_INIT_FAILED);
DLOGD("Successfully initialized curl");

// Not in shutdown
ATOMIC_STORE_BOOL(&pCurlApiCallbacks->shutdown, FALSE);

Expand Down

0 comments on commit a8acd3c

Please sign in to comment.