# 2026-01-04: ubuntu-latest = ubuntu-24.04
# See https://docs.github.com/en/actions/concepts/runners/github-hosted-runners
# and https://github.com/actions/runner-images
name: "Meson: clang"

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Build
      run: |
        # Prevent blocking apt install on a question during configuring of tzdata.
        export ENV DEBIAN_FRONTEND=noninteractive
        sudo apt update
        sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common clang meson ninja-build python3-setuptools --yes
        export CC=clang
        export CXX=clang++
        meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build
        cd _build
        meson compile
    - name: Test
      run: |
        cd _build
        meson test
    - name: Dist
      run: |
        sudo apt install git --yes
        # dist runs setup again so we need to specify CC and CXX again.
        export CC=clang
        export CXX=clang++
        cd _build
        meson dist
