Skip to content

Run tests on arm64 #1944

Run tests on arm64

Run tests on arm64 #1944

Workflow file for this run

name: Test
on:
push:
branches: [ master ]
tags:
- "*"
pull_request:
branches:
- "**"
schedule:
- cron: 30 0 * * *
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
sanitizers:
strategy:
fail-fast: false
matrix:
suffix:
- none
- vectorized
arch:
- amd64
- arm64
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-4core-linux' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create directories
run: mkdir Debug
- name: Install dependencies
if: matrix.arch == 'arm64'
run: sudo apt update ; sudo apt install -y cmake gcc-12 g++-12 git make curl
- name: CMake
env:
CC: gcc-12
CXX: g++-12
run: |
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address,leak,undefined -DASAN_BUILD" \
-DCMAKE_C_FLAGS="-fsanitize=address,leak,undefined -DASAN_BUILD" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,leak,undefined" \
-DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=address,leak,undefined" \
-DLIBDDWAF_VECTORIZED_TRANSFORMERS=$([ "${{ matrix.suffix }}" != "none" ] && echo "ON" || echo "OFF")
working-directory: Debug
- name: Build
run: VERBOSE=1 make -j $(nproc) waf_test waf_validator
working-directory: Debug
- name: Test
run: ASAN_OPTIONS="verbosity=1 fast_unwind_on_malloc=0 detect_leaks=1" make test
working-directory: Debug
- name: Validate
run: ASAN_OPTIONS="verbosity=1 fast_unwind_on_malloc=0 detect_leaks=1" make validate
working-directory: Debug
valgrind:
strategy:
fail-fast: false
matrix:
suffix:
- none
- vectorized
arch:
- amd64
- arm64
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-4core-linux' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update ; sudo apt install -y valgrind cmake gcc-12 g++-12 git make curl
- name: Create directories
run: mkdir Debug
- name: CMake
env:
CC: gcc-12
CXX: g++-12
run: |
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DLIBDDWAF_VECTORIZED_TRANSFORMERS=$([ "${{ matrix.suffix }}" != "none" ] && echo "ON" || echo "OFF")
working-directory: Debug
- name: Build
run: VERBOSE=1 make -j $(nproc) waf_test waf_validator
working-directory: Debug
- name: Test
run: make test_valgrind
working-directory: Debug
- name: Validate
run: make validate_valgrind
working-directory: Debug
coverage:
strategy:
fail-fast: false
matrix:
suffix:
- none
- vectorized
arch:
- amd64
- arm64
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-4core-linux' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update ; sudo apt install -y gcovr cmake gcc-12 g++-12 git make curl
- name: Create directories
run: mkdir Debug
- name: CMake
env:
CC: gcc-12
CXX: g++-12
run: |
cmake .. \
-DLIBDDWAF_TEST_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DLIBDDWAF_VECTORIZED_TRANSFORMERS=$([ "${{ matrix.suffix }}" != "none" ] && echo "ON" || echo "OFF")
working-directory: Debug
- name: Build
run: VERBOSE=1 make -j $(nproc) waf_test waf_validator
working-directory: Debug
- name: Test
run: make test
working-directory: Debug
- name: Validate
run: make validate
working-directory: Debug
- name: Generate coverage
run: |
gcovr --gcov-executable gcov-12 --exclude-throw-branches -v -f '.*src.*' -e ".*src/vendor/.*" -x -o coverage.xml
mkdir -p coverage
gcovr --gcov-executable gcov-12 --html-details coverage/coverage.html --exclude-throw-branches -f ".*src.*" -e ".*src/vendor/.*" -d
working-directory: Debug
- name: Submit coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: waf_test_${{ matrix.suffix }}_${{ matrix.arch }}
verbose: true
files: coverage.xml
- uses: actions/upload-artifact@v4
with:
name: coverage_${{ matrix.suffix }}_${{ matrix.arch }}
path: ${{ github.workspace }}/Debug/coverage/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create directories
run: mkdir Debug
- name: Install clang-{tidy,format}
run: |
DEBIAN_FRONTEND="noninteractive" sudo apt-get -y remove python3-lldb-14
sudo .github/workflows/scripts/llvm.sh 17
sudo apt-get install -y clang-tidy-17 clang-format-17
- name: CMake
env:
CXX: clang++-17
CC: clang-17
run: |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCLANG_TIDY=/usr/bin/run-clang-tidy-17 \
-DCLANG_FORMAT=/usr/bin/clang-format-17
working-directory: Debug
- name: Build
run: VERBOSE=1 make -j $(nproc)
working-directory: Debug
- name: Format
run: make format
working-directory: Debug
- name: Tidy
run: make tidy || true
working-directory: Debug
tools:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create directories
run: mkdir Debug
- name: CMake
env:
CC: gcc-12
CXX: g++-12
run: |
cmake .. -DCMAKE_BUILD_TYPE=Debug
working-directory: Debug
- name: Build
run: VERBOSE=1 make -j $(nproc) verify_rule verify_ruleset waf_runner validate_schema
working-directory: Debug
#verify_ruleset:
#runs-on: ubuntu-latest
#strategy:
#fail-fast: false
#steps:
#- uses: actions/checkout@v4
#with:
#submodules: recursive
#- name: Create directories
#run: mkdir Debug
#- name: CMake
#env:
#CC: gcc-12
#CXX: g++-12
#run: |
#cmake .. -DCMAKE_BUILD_TYPE=Debug
#working-directory: Debug
#- name: Build
#run: VERBOSE=1 make -j $(nproc) verify_ruleset proj_event_rules
#working-directory: Debug
#- name: Verify
#run: ./tools/verify_ruleset ./third_party/proj_event_rules-prefix/src/proj_event_rules/build/recommended.json
#working-directory: Debug