Skip to content

Commit

Permalink
Meson build system support
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovazquezblanco committed Dec 28, 2023
1 parent 610f63a commit b5ce926
Show file tree
Hide file tree
Showing 25 changed files with 308 additions and 692 deletions.
27 changes: 0 additions & 27 deletions .github/actions/build/action.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/actions/package/action.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/actions/test/action.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/dependabot.yml
Expand Up @@ -8,8 +8,3 @@ updates:
target-branch: "develop"
schedule:
interval: "weekly"
- package-ecosystem: "gitsubmodule"
directory: "/"
target-branch: "develop"
schedule:
interval: "weekly"
15 changes: 7 additions & 8 deletions .github/labeler.yml
@@ -1,16 +1,15 @@
ci:
- .github/**
- any: ['.github/**']

build_system:
- 'CMake*'
- '**/CMakeLists.txt'
- '**/*.cmake'
build-system:
- meson_options.txt
- '**/meson.build'

sigutils:
- any: ['src/**', '!src/CMakeLists.txt']
- any: ['src/**', '!**/meson.build']

documentation:
- any: ['doc/**', '!doc/CMakeLists.txt']
- any: ['doc/**', '!**/meson.build']

tests:
- any: ['tests/**', '!tests/CMakeLists.txt']
- any: ['tests/**', '!**/meson.build']
111 changes: 28 additions & 83 deletions .github/workflows/build.yml
Expand Up @@ -3,104 +3,49 @@ name: Build
on: [push, pull_request, workflow_dispatch]

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libsndfile1-dev libvolk2-dev libfftw3-dev catch2

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Build
uses: "./.github/actions/build"
with:
target: sigutils
cmake_configuration_parameters: -DCMAKE_INSTALL_PREFIX=/usr

- name: Build tests
uses: "./.github/actions/build"
with:
target: sigutils_test

- name: Test
uses: "./.github/actions/test"

- name: Package
uses: "./.github/actions/package"
with:
generators: TGZ;DEB

build-macos:
runs-on: macos-latest
steps:
- name: Install dependencies
run: brew install libsndfile volk fftw catch2

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Build
uses: "./.github/actions/build"
with:
target: sigutils
build:
strategy:
matrix:
sys:
- { os: windows-latest, shell: 'msys2 {0}' }
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }

- name: Build tests
uses: "./.github/actions/build"
with:
target: sigutils_test
runs-on: ${{ matrix.sys.os }}

- name: Test
uses: "./.github/actions/test"

- name: Package
uses: "./.github/actions/package"
with:
generators: TGZ

build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
shell: ${{ matrix.sys.shell }}

steps:
- name: Install dependencies
- name: Install dependencies (Ubuntu)
if: matrix.sys.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install meson libsndfile1-dev libvolk2-dev libfftw3-dev catch2
- name: Install dependencies (Mac OS)
if: matrix.sys.os == 'macos-latest'
run: brew install meson libsndfile volk fftw catch2

- name: Install dependencies (Windows)
if: matrix.sys.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-libsndfile mingw-w64-x86_64-fftw mingw-w64-x86_64-volk mingw-w64-x86_64-catch
install: git mingw-w64-x86_64-meson mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc mingw-w64-x86_64-libsndfile mingw-w64-x86_64-fftw mingw-w64-x86_64-volk mingw-w64-x86_64-catch

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Build
uses: "./.github/actions/build"
with:
shell: msys2 {0}
target: sigutils
- name: Configure
run: meson setup builddir

- name: Build tests
uses: "./.github/actions/build"
with:
shell: msys2 {0}
target: sigutils_test
- name: Build
run: meson compile -C builddir

- name: Test
uses: "./.github/actions/test"
with:
shell: msys2 {0}

- name: Package
uses: "./.github/actions/package"
with:
generators: ZIP
run: meson test -C builddir
7 changes: 4 additions & 3 deletions .github/workflows/codeql.yml
Expand Up @@ -28,7 +28,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Initialize CodeQL
Expand All @@ -37,8 +36,10 @@ jobs:
languages: ${{ matrix.language }}

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libsndfile1-dev libvolk2-dev libfftw3-dev

run: |
sudo apt-get update
sudo apt-get install meson libsndfile1-dev libvolk2-dev libfftw3-dev
- name: Autobuild
uses: github/codeql-action/autobuild@v2

Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/doc.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libsndfile1-dev libvolk2-dev libfftw3-dev doxygen python3-pip
sudo apt-get install meson libsndfile1-dev libvolk2-dev libfftw3-dev doxygen graphviz python3-pip
sudo pip3 install coverxygen
- name: Determine checkout ref
Expand All @@ -30,18 +30,18 @@ jobs:
with:
ref: "${{ steps.fetch_ref.outputs.value }}"
fetch-depth: 0
submodules: true

- name: Configure
run: meson setup builddir

- name: Build documentation
uses: "./.github/actions/build"
with:
target: doxygen
run: meson compile -C builddir docs

- name: Upload documentation artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: build/doc/html/
path: builddir/doc/html/

- name: Setup Pages
if: contains(github.ref, 'develop') && (github.event_name != 'pull_request_target')
Expand All @@ -53,24 +53,22 @@ jobs:
if: contains(github.ref, 'develop') && (github.event_name != 'pull_request_target')
uses: actions/upload-pages-artifact@v2
with:
path: build/doc/html/
path: builddir/doc/html/

- name: Deploy to GitHub Pages
if: contains(github.ref, 'develop') && (github.event_name != 'pull_request_target')
uses: actions/deploy-pages@v3

- name: Documentation coverage
if: github.event_name == 'pull_request_target'
uses: "./.github/actions/build"
with:
target: coverxygen_summary
run: meson compile -C builddir docs_coverage

- name: Documentation coverage report generation
if: github.event_name == 'pull_request_target'
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "report<<$EOF" >> "$GITHUB_ENV"
cat build/doc/doc-coverage.markdown-summary.info >> "$GITHUB_ENV"
cat builddir/doc/coverxygen.md >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- name: Documentation coverage report
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
@@ -1,9 +1,6 @@
[submodule "cmake/cmake-gitversiondetect"]
path = cmake/cmake-gitversiondetect
url = https://github.com/antoniovazquezblanco/cmake-gitversiondetect.git
[submodule "cmake/cmake-pcfilegenerator"]
path = cmake/cmake-pcfilegenerator
url = https://github.com/antoniovazquezblanco/cmake-pcfilegenerator.git
[submodule "cmake/cmake-relativefilemacro"]
path = cmake/cmake-relativefilemacro
url = https://github.com/antoniovazquezblanco/cmake-relativefilemacro.git

0 comments on commit b5ce926

Please sign in to comment.