Skip to content

Commit

Permalink
ci: add meson support
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Sep 19, 2024
1 parent 2f29d15 commit f8fa29f
Showing 1 changed file with 51 additions and 6 deletions.
57 changes: 51 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with: { submodules: recursive }
- name: Configuring
run: |
Expand All @@ -53,12 +53,57 @@ 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
extra_envs:
- {}
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/[email protected]
Expand All @@ -77,7 +122,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: |
Expand Down Expand Up @@ -109,7 +154,7 @@ jobs:
dry-run: false
sanitizer: ${{ matrix.sanitizer }}
- name: Upload Crash
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-artifacts
Expand Down

0 comments on commit f8fa29f

Please sign in to comment.