Skip to content

pattern: Make sure getValue always returns a valid pattern #557

pattern: Make sure getValue always returns a valid pattern

pattern: Make sure getValue always returns a valid pattern #557

Workflow file for this run

name: "Unit Tests"
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
tests:
name: 🧪 Unit Tests
runs-on: ubuntu-22.04
env:
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
actions: read
contents: read
security-events: write
steps:
- name: 🧰 Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: ⬇️ Install dependencies
run: |
sudo apt update
sudo apt install -y \
build-essential \
gcc-12 \
g++-12 \
lld \
${PKGCONF:-} \
cmake \
make \
lcov
- name: 🛠️ Build
run: |
mkdir -p build
cd build
CC=gcc-12 CXX=g++-12 cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-O0 -fuse-ld=lld --coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=all" \
-DCMAKE_CXX_FLAGS="-O0 -fuse-ld=lld --coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=all" \
-DLIBPL_ENABLE_TESTS=ON \
-DLIBPL_ENABLE_CLI=OFF \
..
make -j4 pattern_language_tests
- name: 🧪 Perform Unit Tests
run: |
cd build
ctest --output-on-failure
- name: ✉️ Run ImHex-Patterns tests
if: ${{ env.DISPATCH_TOKEN != '' }}
uses: mvasigh/dispatch-action@main
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repo: ImHex-Patterns
owner: WerWolv
event_type: run_tests
- name: ⚗️ Generate Coverage Report
if: ${{ env.DISPATCH_TOKEN != '' }}
run: |
cd build
lcov -d ./lib --gcov-tool /usr/bin/gcov-12 -c -o coverage.info
- name: ⬆️ Upload Coverage Report
if: ${{ env.DISPATCH_TOKEN != '' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: build/coverage.info