Skip to content

CI enhancements: Code linter, PR description, speed up #521

CI enhancements: Code linter, PR description, speed up

CI enhancements: Code linter, PR description, speed up #521

Workflow file for this run

name: PIC CI
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
env:
AWS_KVS_LOG_LEVEL: 2
TEST_FILTER: "-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
jobs:
mac-tests:
strategy:
matrix:
os: [ macos-13, macos-15 ]
config:
- name: Default Build
cmake_flags: "-DBUILD_TEST=TRUE"
- name: Aligned Memory Model Build
cmake_flags: "-DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE"
compiler: [ gcc, clang ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up compiler
run: |
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then
brew install gcc
else
brew install llvm
fi
- name: Configure and build ${{ matrix.config.name }}
run: |
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then
export CC="gcc"
export CXX="g++"
else
export CC="clang"
export CXX="clang++"
fi
echo "Using $CC and $CXX"
mkdir -p build
cd build
cmake .. ${{ matrix.config.cmake_flags }}
make -j$(sysctl -n hw.ncpu)
shell: bash
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="${{ env.TEST_FILTER }}"
shell: bash
linux-gcc-code-coverage:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Build repository
run: |
mkdir build && cd build
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="${{ env.TEST_FILTER }}"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="${{ env.TEST_FILTER }}"
- name: Code coverage
run: |
for test_file in $(find CMakeFiles/kvspic.dir CMakeFiles/kvspicClient.dir CMakeFiles/kvspicState.dir CMakeFiles/kvspicUtils.dir -name '*.gcno'); do gcov $test_file; done
bash <(curl -s https://codecov.io/bash)
linux-sanitizers:
strategy:
matrix:
sanitizer:
- ADDRESS_SANITIZER
- UNDEFINED_BEHAVIOR_SANITIZER
- THREAD_SANITIZER
# - MEMORY_SANITIZER
config:
- name: Default Build
cmake_flags: "-DBUILD_TEST=TRUE"
- name: Aligned Memory Model Build
cmake_flags: "-DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE"
fail-fast: false
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install clang
- name: Build repository - ${{ matrix.config.name }}
run: |
mkdir -p build
cd build
cmake .. -D${{ matrix.sanitizer }}=TRUE ${{ matrix.config.cmake_flags }}
make
- name: Configure sanitizers
run: |
if [[ "${{ matrix.sanitizer }}" == "UNDEFINED_BEHAVIOR_SANITIZER" ]]; then
echo "UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1:suppressions=../../tst/suppressions/UBSAN.supp" >> $GITHUB_ENV
elif [[ "${{ matrix.sanitizer }}" == "THREAD_SANITIZER" ]]; then
echo "TSAN_OPTIONS=halt_on_error=1:suppressions=../../tst/suppressions/TSAN.supp" >> $GITHUB_ENV
fi
- name: Run tests - ${{ matrix.config.name }}
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="${{ env.TEST_FILTER }}"
linux-gcc-4_4:
runs-on: ubuntu-20.04
strategy:
matrix:
config:
- name: Default Build
cmake_flags: "-DBUILD_TEST=TRUE"
- name: Aligned Memory Model Build
cmake_flags: "-DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE"
fail-fast: false
env:
CC: gcc-4.4
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install deps
run: |
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty main'
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty universe'
sudo apt-get -q update
sudo apt-get -y install gcc-4.4
sudo apt-get -y install gdb
- name: Build repository
run: |
mkdir build && cd build
cmake .. ${{ matrix.config.cmake_flags }}
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="${{ env.TEST_FILTER }}"
arm-cross-compilation:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [ arm32, arm64 ]
config:
- name: Default Build
cmake_flags: "-DBUILD_TEST=TRUE"
- name: Aligned Memory Model Build
cmake_flags: "-DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE"
fail-fast: false
steps:
- name: Install dependencies
run: |
sudo apt update
if [[ "${{ matrix.arch }}" == "arm64" ]]; then
sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
else
sudo apt-get -y install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi
fi
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Repository - ${{ matrix.arch }} - ${{ matrix.config.name }}
run: |
if [[ "${{ matrix.arch }}" == "arm64" ]]; then
export CC="aarch64-linux-gnu-gcc"
export CXX="aarch64-linux-gnu-g++"
else
export CC="arm-linux-gnueabi-gcc"
export CXX="arm-linux-gnueabi-g++"
fi
echo "Using compiler $CC and $CXX for ${{ matrix.arch }}"
mkdir -p build
cd build
cmake .. ${{ matrix.config.cmake_flags }}
make -j$(nproc)
windows-msvc:
runs-on: windows-2022
env:
AWS_KVS_LOG_LEVEL: 7
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Build and run
run: |
.github/build_windows.bat
- name: Run tests
run: |
D:\a\amazon-kinesis-video-streams-pic\amazon-kinesis-video-streams-pic\build\tst\kvspic_test.exe --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*:PermutatedStreamInfo/StateTransitionFunctionalityTest.ControlPlaneServiceCallExhaustRetry*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateTimerInvokedBeforeTime*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateTimerInvokedAfterFirstPeriod*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateLastUpdateTimeOfStreamUpdated*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.MultiTrackVerifyNoInvocationsWithSingleTrackProducer*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateNoConsecutiveEOFR*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateErrorOnForceConsecutiveEOFR*:*StreamStateTransitionsTest*:*PermutatedStreamInfo/StateTransitionFunctionalityTest.StreamTerminatedAndGoToGetEndpointState*:*PermutatedStreamInfo/StateTransitionFunctionalityTest.StreamTerminatedAndGoToDescribeState*:*PermutatedStreamInfo/StateTransitionFunctionalityTest*"