~hp/synthpod

f3c38b4462cce7358488e2acc5a8ee94ebf7b9e5 — Hanspeter Portner 8 months ago 6c0b6db
ci: update to .builds dir
4 files changed, 132 insertions(+), 56 deletions(-)

D .build.yml
A .builds/alpine-latest.yml
M meson.build
M meson_options.txt
D .build.yml => .build.yml +0 -17
@@ 1,17 0,0 @@
# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
# SPDX-License-Identifier: CC0-1.0

image: alpine/latest
packages:
  - reuse
  - meson
tasks:
  - setup: |
      cd lfrtm
      meson setup build
  - build: |
      cd lfrtm
      ninja -C build
  - test: |
      cd lfrtm
      ninja -C build test

A .builds/alpine-latest.yml => .builds/alpine-latest.yml +76 -0
@@ 0,0 1,76 @@
# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
# SPDX-License-Identifier: CC0-1.0

---

image: alpine/latest

packages:
  - clang16-analyzer
  - llvm16
  - reuse
  - meson
  - git-subtree
  - hut
  - jq
  - valgrind

environment:
  project: lfrtm

secrets:
  - 0545580c-42ac-4700-b322-4e9df924eb07 # runner-ssh
  - 5fe806cd-3af4-4588-9898-8115d9262144 # hut-config
  - d6d10b2a-542a-4b45-b1be-6ef30a8ab558 # git-config
  - 3de1773e-3503-46f5-8ab4-5212026517f4 # pgp-key

sources:
  - https://git.open-music-kontrollers.ch/~hp/ci

tasks:
  - gcc: |
      . ~/ci/activate

      ci-meson gcc setup
      ci-meson gcc build
      ci-meson gcc test
      ci-meson gcc memcheck

  - clang: |
      . ~/ci/activate

      ci-meson clang setup
      ci-meson clang build
      ci-meson clang test
      ci-meson clang memcheck

  - analyzer: |
      . ~/ci/activate

      ci-meson analyzer setup
      ci-meson analyzer build
      ci-meson analyzer test

  - sign: |
      . ~/ci/activate

      if ! ci-istag; then
        complete-build
      fi

      ci-archivesign

  - deploy: |
      . ~/ci/activate

      if ! ci-isrelease; then
        complete-build
      fi

      ci-subtreemerge

triggers:
  - action: email
    condition: failure
    to: "<dev@open-music-kontrollers.ch>"
...

M meson.build => meson.build +52 -39
@@ 4,62 4,75 @@
project('lfrtm', 'c', default_options : [
	'buildtype=release',
	'warning_level=3',
	'werror=true',
	'b_lto=false',
	'werror=false',
	'b_lto=true',
	'c_std=c11'])

build_tests = get_option('build-tests')

reuse = find_program('reuse', required : false)

add_project_arguments('-D_GNU_SOURCE', language : 'c')

thread_dep = dependency('threads')
cc = meson.get_compiler('c')
rt_dep = cc.find_library('rt')

lib_deps = []
lib_deps = [
  rt_dep
]

lib_incs = []
lib_incs += include_directories('')
lib_incs = [
  include_directories('')
]

lib_srcs = []
lib_srcs += join_paths('src', 'lfrtm.c')
lib_srcs = [
  join_paths('src', 'lfrtm.c')
]

lfrtm = declare_dependency(
  include_directories : lib_incs,
  dependencies : lib_deps,
  sources : lib_srcs)

test_deps = []
test_deps += lfrtm 
test_deps += thread_dep
if build_tests
  thread_dep = dependency('threads')

  test_deps = [
    lfrtm,
    thread_dep
  ]

test_srcs = []
test_srcs += join_paths('test', 'test.c')
  test_srcs = [
    join_paths('test', 'test.c')
  ]

lfrtm_test = executable('lfrtm_test', test_srcs,
	dependencies : test_deps,
	install : false)
  test_lfrtm = executable('test_lfrtm', test_srcs,
    dependencies : test_deps,
    install : false)

test(' 1 threads', lfrtm_test,
	args : ['1'],
	timeout : 240)
test(' 2 threads', lfrtm_test,
	args : ['2'],
	timeout : 240)
test(' 4 threads', lfrtm_test,
	args : ['4'],
	timeout : 240)
test(' 8 threads', lfrtm_test,
	args : ['8'],
	timeout : 240)
test('16 threads', lfrtm_test,
  args : ['16'],
  timeout : 240)
test('32 threads', lfrtm_test,
  args : ['32'],
  timeout : 240)
  test(' 1 threads', test_lfrtm,
    args : ['1'],
    timeout : 240)
  test(' 2 threads', test_lfrtm,
    args : ['2'],
    timeout : 240)
  test(' 4 threads', test_lfrtm,
    args : ['4'],
    timeout : 240)
  test(' 8 threads', test_lfrtm,
    args : ['8'],
    timeout : 240)
  test('16 threads', test_lfrtm,
    args : ['16'],
    timeout : 240)
  test('32 threads', test_lfrtm,
    args : ['32'],
    timeout : 240)

if reuse.found()
  test('REUSE', reuse, args : [
    '--root', meson.current_source_dir(),
    'lint'
  ])
  if reuse.found()
    test('REUSE', reuse, args : [
      '--root', meson.current_source_dir(),
      'lint'
    ])
  endif
endif

M meson_options.txt => meson_options.txt +4 -0
@@ 1,4 1,8 @@
# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
# SPDX-License-Identifier: CC0-1.0

option('build-tests',
	type : 'boolean',
	value : true)

option('version', type : 'string', value : '0.1.57')