diff --git a/.github/workflows/workflow.yml b/.github/workflows/cmake.yml similarity index 90% rename from .github/workflows/workflow.yml rename to .github/workflows/cmake.yml index b1443a0d..3a453b2c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/cmake.yml @@ -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: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..5d0df95d --- /dev/null +++ b/.github/workflows/main.yml @@ -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 }}