Update meson_ci.yml #505
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Meson CI | |
| on: | |
| schedule: | |
| - cron: '15 21 * * *' | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build_microslop: | |
| name: Building on Microslop ${{ matrix.msvc_version }} | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| msvc_version: [2019, 2022, 2025] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Meson and Ninja | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install meson ninja | |
| if ($env:msvc_version -eq "2019") { | |
| choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" | |
| } elseif ($env:msvc_version -eq "2022") { | |
| choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" | |
| } elseif ($env:msvc_version -eq "2025") { | |
| choco install visualstudio2025buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" | |
| } | |
| $env:CC="cl.exe" | |
| $env:CXX="cl.exe" | |
| - name: Configure | |
| run: meson setup builddir_msvc_${{ matrix.msvc_version }} --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 | |
| - name: Run Tests | |
| run: meson test -C builddir_msvc_${{ matrix.msvc_version }} -v --test-args='show --mode tree --verbose ci --result fail' | |
| build_macosx: | |
| name: Building on MacOSX | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Xcode Command Line Tools | |
| run: | | |
| if ! xcode-select -p &>/dev/null; then | |
| sudo xcode-select --install | |
| until xcode-select -p &>/dev/null; do sleep 5; done | |
| fi | |
| - name: Install Xcode | |
| run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer | |
| - name: Install Meson, Ninja | |
| run: | | |
| python -m pip install meson ninja | |
| - name: Configure | |
| run: OBJC=clang OBJCXX=clang++ meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 | |
| - name: Compile | |
| run: meson compile -C builddir | |
| - name: Run Tests | |
| run: meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail' | |
| - name: Upload Test Log | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: macos_xcode_${{ matrix.xcode_version }}_meson_testlog | |
| path: builddir/meson-logs/testlog.txt | |
| build_posix: | |
| name: Build on Linux ${{ matrix.distro }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| distro: [ubuntu, fedora, archlinux, debian] # in a new experiment add alpine and opensuse | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ matrix.distro }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx | |
| - name: Build Docker Image | |
| run: | | |
| docker build \ | |
| --file .github/ciimage/Dockerfile.${{ matrix.distro }} \ | |
| --tag ${GITHUB_REPOSITORY}:${{ matrix.distro }} . | |
| - name: Run Meson Build in Docker Container | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -w /workspace \ | |
| ${GITHUB_REPOSITORY}:${{ matrix.distro }} \ | |
| /bin/bash -c " | |
| sudo apt update | |
| meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 | |
| meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'" |