Skip to content

Commit

Permalink
ci: add meson build/tests with sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Oct 11, 2024
1 parent 89737c5 commit 6c8739f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: "Main Workflow"
name: "CMake CI"
on:
pull_request:
push:

jobs:
build_and_test:
cmake-build:
runs-on: ubuntu-latest
env:
CFLAGS: -DSTC_STATIC -Wall -Wno-unused-function -ggdb3 -fsanitize=address -fsanitize=undefined -fsanitize=pointer-compare -fsanitize=pointer-subtract
CXXFLAGS: -DSTC_STATIC -Wall -Wno-unused-function -ggdb3 -fsanitize=address -fsanitize=undefined -fsanitize=pointer-compare -fsanitize=pointer-subtract
steps:
- name: 'Checkout'
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: 'Build & Test'
uses: ashutoshvarma/action-cmake-build@master
with:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
pull_request:
push:

jobs:
meson-build-and-tests:
runs-on: ${{ matrix.platform }}
name: >-
Meson build + tests (${{ matrix.platform }}, ${{ matrix.mode.name }} ${{ matrix.flavor }})
strategy:
fail-fast: false
matrix:
flavor:
- debug
- release
mode:
- { name: default, args: -Dtests=enabled }
- { name: sanitize, args: "-Db_sanitize=address,undefined" }
platform:
- macos-latest
- windows-2022
- ubuntu-22.04

steps:
- name: Setup meson
run: |
pipx install meson ninja
- name: Checkout
uses: actions/checkout@v4
with: { submodules: recursive }
- name: Activate MSVC and Configure
if: ${{ matrix.platform == 'windows-2022' }}
run: |
meson setup build-${{ matrix.flavor }} --buildtype=${{ matrix.flavor }} ${{ matrix.mode.args }} --vsenv
- name: Configuring
if: ${{ matrix.platform != 'windows-2022' }}
run: |
meson setup build-${{ matrix.flavor }} --buildtype=${{ matrix.flavor }} ${{ matrix.mode.args }}
- name: Building
run: |
meson compile -C build-${{ matrix.flavor }}
- name: Running tests
run: |
meson test -C build-${{ matrix.flavor }}

0 comments on commit 6c8739f

Please sign in to comment.