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 May 5, 2024
1 parent 6b37442 commit e003275
Show file tree
Hide file tree
Showing 25 changed files with 343 additions and 724 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ updates:
target-branch: "master"
schedule:
interval: "weekly"
- package-ecosystem: "gitsubmodule"
directory: "/"
target-branch: "master"
schedule:
interval: "weekly"
11 changes: 5 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@ build_system:
- all:
- changed-files:
- any-glob-to-any-file:
- 'CMake*'
- '**/CMakeLists.txt'
- '**/*.cmake'
- meson_options.txt
- '**/meson.build'

sigutils:
- all:
- changed-files:
- any-glob-to-any-file: 'src/**'
- all-globs-to-all-files: '!src/CMakeLists.txt'
- all-globs-to-all-files: '!**/meson.build'

documentation:
- all:
- changed-files:
- any-glob-to-any-file: 'doc/**'
- all-globs-to-all-files: '!doc/CMakeLists.txt'
- all-globs-to-all-files: '!**/meson.build'

tests:
- all:
- changed-files:
- any-glob-to-any-file: 'tests/**'
- all-globs-to-all-files: '!tests/CMakeLists.txt'
- all-globs-to-all-files: '!**/meson.build'
179 changes: 62 additions & 117 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,138 +3,83 @@ 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
build:
strategy:
matrix:
sys:
- { os: windows-latest, shell: 'msys2 {0}' }
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }

- 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"
runs-on: ${{ matrix.sys.os }}

- 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

- 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

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 -vd 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

release:
runs-on: "ubuntu-latest"
needs:
- build-linux
- build-macos
- build-windows

steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Download binaries
uses: actions/download-artifact@v4

- name: Release nightly
if: github.ref == 'refs/heads/master'
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Sigutils nightly (${{steps.date.outputs.date}})"
files: sigutils*/*

- name: Release stable
if: contains(github.ref, 'refs/tags/v')
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: "Sigutils ${{github.ref_name}}"
files: sigutils*/*
run: meson test -C builddir

# TODO: Package
# TODO: Upload artifacts

# release:
# runs-on: "ubuntu-latest"
# needs: build

# steps:
# - name: Get current date
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

# - name: Download binaries
# uses: actions/download-artifact@v4

# - name: Release nightly
# if: github.ref == 'refs/heads/master'
# uses: marvinpinto/[email protected]
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "latest"
# prerelease: true
# title: "Sigutils nightly (${{steps.date.outputs.date}})"
# files: sigutils*/*

# - name: Release stable
# if: contains(github.ref, 'refs/tags/v')
# uses: marvinpinto/[email protected]
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# prerelease: false
# title: "Sigutils ${{github.ref_name}}"
# files: sigutils*/*
7 changes: 4 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
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@v3

Expand Down
Loading

0 comments on commit e003275

Please sign in to comment.