Skip to content

Commit

Permalink
meson: Initial build system support
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovazquezblanco committed May 6, 2024
1 parent 6b37442 commit 1d929de
Show file tree
Hide file tree
Showing 15 changed files with 350 additions and 242 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: "master"
schedule:
interval: "weekly"
- package-ecosystem: "gitsubmodule"
directory: "/"
target-branch: "master"
schedule:
interval: "weekly"
10 changes: 7 additions & 3 deletions .github/labeler.yml
Expand Up @@ -7,6 +7,8 @@ build_system:
- all:
- changed-files:
- any-glob-to-any-file:
- meson_options.txt
- '**/meson.build'
- 'CMake*'
- '**/CMakeLists.txt'
- '**/*.cmake'
Expand All @@ -15,16 +17,18 @@ 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'
- all-globs-to-all-files: '!**/CMakeLists.txt'

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'
- all-globs-to-all-files: '!**/CMakeLists.txt'
182 changes: 63 additions & 119 deletions .github/workflows/build.yml
Expand Up @@ -3,138 +3,82 @@ 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
msystem: UCRT64
install: git mingw-w64-ucrt-x86_64-meson mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-libsndfile mingw-w64-ucrt-x86_64-fftw mingw-w64-ucrt-x86_64-volk mingw-w64-ucrt-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/action-automatic-releases@v1.2.1
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/action-automatic-releases@v1.2.1
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/action-automatic-releases@v1.2.1
# 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/action-automatic-releases@v1.2.1
# 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
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

0 comments on commit 1d929de

Please sign in to comment.