From eef713e00a5b5a62afb56c2c42c5d7880eb85537 Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Thu, 19 Sep 2024 22:38:05 +0800 Subject: [PATCH] ci: add meson support --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8933ff9a..cf3125f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,8 @@ jobs: matrix: include: # Do a regular and a no-libc build for each platform. - - image_name: macOS-latest - - image_name: macOS-latest + - image_name: macos-latest + - image_name: macos-latest cmake_flags: -DZYAN_NO_LIBC=ON skip_tests: yes - image_name: windows-2022 @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: { submodules: recursive } - name: Configuring run: | @@ -53,12 +53,55 @@ jobs: cd build ctest -C Release --output-on-failure + meson-build-and-tests: + name: >- + Meson build + tests (${{ matrix.platform }}, ${{ matrix.flavor }} ${{ matrix.mode.name }}) + runs-on: ${{ matrix.platform }} + + strategy: + fail-fast: false + matrix: + flavor: + - debug + - release + mode: + - { name: default, args: -Dtests=enabled } + - { name: NO_LIBC, args: -Dnolibc=true } + platform: + - macos-latest + - windows-2022 + - ubuntu-22.04 + include: + # Do a few more specialized configurations. + - platform: ubuntu-22.04 + mode: { name: minimal, args: -Dminimal=true -Dencoder=enabled -Davx512=enabled -Dknc=enabled -Dsegment=enabled -Dtests=enabled } + - platform: windows-2022 + extra_envs: { CC: clang-cl } + + steps: + - name: Setup meson + run: | + pipx install meson ninja + - name: Checkout + uses: actions/checkout@v4 + with: { submodules: recursive } + - name: Configuring + env: ${{ matrix.extra_envs }} + run: | + meson setup build-${{ matrix.flavor }} ${{ matrix.mode.args }} + - name: Building + run: | + meson compile -C build-${{ matrix.flavor }} + - name: Running tests + run: | + meson test -C build-${{ matrix.flavor }} + msbuild-build: name: MSBuild build (windows-2022) runs-on: windows-2022 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: { submodules: recursive } - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1.3 @@ -77,7 +120,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: { submodules: recursive } - name: Amalgamating sources run: |