CI: Add support for sanitizers

This commit is contained in:
Lynix 2023-10-25 20:24:25 +02:00
parent bb9f907691
commit 89690fb710
1 changed files with 12 additions and 6 deletions

View File

@ -23,7 +23,13 @@ jobs:
matrix:
os: [ubuntu-latest]
arch: [x86_64]
mode: [asan, tsan, debug, releasedbg]
mode: [debug, releasedbg]
confs:
- { mode: debug }
- { mode: debug, config: --asan=y }
- { mode: debug, config: --lsan=y }
- { mode: debug, config: --msan=y }
- { mode: releasedbg }
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
@ -67,11 +73,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Linux-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
key: Linux-${{ matrix.arch }}-${{ matrix.confs.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
# Build the engine
- name: Build Nazara
@ -79,12 +85,12 @@ jobs:
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
if: matrix.confs.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration
- name: Configure xmake for installation
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes
# Install the result files
- name: Install Nazara
@ -93,5 +99,5 @@ jobs:
# Upload artifacts
- uses: actions/upload-artifact@v3
with:
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.confs.mode }}
path: package