diff --git a/.busted.lua b/.busted.lua index 3aa0614..cfafed4 100644 --- a/.busted.lua +++ b/.busted.lua @@ -1,7 +1,6 @@ return { default = { verbose = true, - helper = "./spec/_helper.lua", lpath = "./src/?.lua;./src/?/init.lua;./src/?/?.lua;./tests/?.lua", }, } diff --git a/.ci/pipeline.yml b/.ci/pipeline.yml new file mode 100644 index 0000000..7e66b4e --- /dev/null +++ b/.ci/pipeline.yml @@ -0,0 +1,53 @@ +--- +resources: +- name: repo + type: git + icon: github + source: + uri: https://git.sclu1034.dev/lucas/lua-libpulse-glib + branch: ci + +jobs: +- name: test + plan: + - get: repo + trigger: true + - in_parallel: + - task: run-test-5.1 + file: repo/.ci/test.yml + vars: + lua-version: 5.1 + - task: run-test-5.2 + file: repo/.ci/test.yml + vars: + lua-version: 5.2 + - task: run-test-5.3 + file: repo/.ci/test.yml + vars: + lua-version: 5.3 + - task: run-test-5.4 + file: repo/.ci/test.yml + vars: + lua-version: 5.4 + +- name: rock + plan: + - get: repo + trigger: true + - in_parallel: + - task: run-rock-5.1 + file: repo/.ci/rock.yml + vars: + lua-version: 5.1 + - task: run-rock-5.2 + file: repo/.ci/rock.yml + vars: + lua-version: 5.2 + - task: run-rock-5.3 + file: repo/.ci/rock.yml + vars: + lua-version: 5.3 + - task: run-rock-5.4 + file: repo/.ci/rock.yml + vars: + lua-version: 5.4 diff --git a/.ci/rock.sh b/.ci/rock.sh new file mode 100755 index 0000000..4e863aa --- /dev/null +++ b/.ci/rock.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -ex + +sudo enable-lua ${LUA_VERSION:-5.1} +eval "$(luarocks --lua-version ${LUA_VERSION:-5.1} path)" + +luarocks --lua-version ${LUA_VERSION:-5.1} install lgi +luarocks --lua-version ${LUA_VERSION:-5.1} install ldoc +luarocks --lua-version ${LUA_VERSION:-5.1} install lua-discount + +luarocks --lua-version ${LUA_VERSION:-5.1} make rocks/lua-libpulse-glib-scm-1.rockspec + +sudo disable-lua ${LUA_VERSION:-5.1} diff --git a/.ci/rock.yml b/.ci/rock.yml new file mode 100644 index 0000000..e8754b4 --- /dev/null +++ b/.ci/rock.yml @@ -0,0 +1,20 @@ + +--- +platform: linux + +image_resource: + type: registry-image + source: + repository: registry.local:5000/lua-clib-pulse + tag: latest + +inputs: +- name: repo + +params: + CI: true + LUA_VERSION: ((lua-version)) + +run: + path: .ci/rock.sh + dir: repo diff --git a/.ci/test.sh b/.ci/test.sh new file mode 100755 index 0000000..f07b1ff --- /dev/null +++ b/.ci/test.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -ex + +mkdir -p "${BUILD_DIR:-./build}" + +CMAKE_ARGS="" + +if [ -n "$CI" ]; then + CMAKE_ARGS="-DCI=ON" +fi + +sudo enable-lua ${LUA_VERSION:-5.1} +eval "$(luarocks --lua-version ${LUA_VERSION:-5.1} path)" + +luarocks --lua-version ${LUA_VERSION:-5.1} install busted +luarocks --lua-version ${LUA_VERSION:-5.1} install lgi +luarocks --lua-version ${LUA_VERSION:-5.1} install ldoc +luarocks --lua-version ${LUA_VERSION:-5.1} install lua-discount + +make -j $(nproc) -C ${SOURCE_DIR:-.} LUA_VERSION=${LUA_VERSION:-5.1} LUA=lua + +sudo disable-lua ${LUA_VERSION:-5.1} diff --git a/.ci/test.yml b/.ci/test.yml new file mode 100644 index 0000000..0b0dc5d --- /dev/null +++ b/.ci/test.yml @@ -0,0 +1,20 @@ +--- +platform: linux + +image_resource: + type: registry-image + source: + repository: registry.local:5000/lua-clib-pulse + tag: latest + +inputs: +- name: repo + +params: + CI: true + SOURCE_DIR: repo + BUILD_DIR: /tmp/build-output + LUA_VERSION: ((lua-version)) + +run: + path: repo/.ci/test.sh diff --git a/Makefile b/Makefile index 0e47432..a8899ee 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,9 @@ TEST_ARGS ?= --output=TAP CCFLAGS += -Werror endif -.PHONY: clean doc doc-content doc-styles install uninstall test check rock +.PHONY: all clean doc doc-content doc-styles install uninstall test check rock + +all: build doc build: $(TARGET) diff --git a/README.adoc b/README.adoc index 77416f8..0e4d6cb 100644 --- a/README.adoc +++ b/README.adoc @@ -5,7 +5,6 @@ ifdef::env-github,env-browser[] :toc: macro :toclevels: 1 endif::[] -ifdef::env-github[] :branch: master :status: :outfilesuffix: .adoc @@ -15,16 +14,15 @@ ifdef::env-github[] :note-caption: :paperclip: :tip-caption: :bulb: :warning-caption: :warning: -endif::[] -:url-ci-github: https://github.com/sclu1034/lua-libpulse-glib/actions -:url-ci-badge-github: https://img.shields.io/github/workflow/status/sclu1034/lua-libpulse-glib/Lint%20&%20Test?style=flat-square +:url-ci: https://ci.sclu1034.dev/teams/main/pipelines/lgi-libpulse-glib +:url-ci-badge: https://ci.sclu1034.dev/api/v1/teams/main/pipelines/lgi-libpulse-glib/badge :url-license-badge: https://img.shields.io/badge/license-GPLv3-brightgreen?style=flat-square :url-luarocks-badge: https://img.shields.io/luarocks/v/sclu1034/lua-libpulse-glib?style=flat-square :url-luarocks-link: https://luarocks.org/modules/sclu1034/lua-libpulse-glib image:{url-license-badge}[License] ifdef::status[] -image:{url-ci-badge-github}[Build Status (GitHub Actions), link={url-ci-github}] +image:{url-ci-badge}[Build Status (Concourse CI), link={url-ci}] endif::[] image:{url-luarocks-badge}[LuaRocks Package, link={url-luarocks-link}] diff --git a/src/lua_libpulse_glib/proplist.h b/src/lua_libpulse_glib/proplist.h index 15d2d31..4c3d3e2 100644 --- a/src/lua_libpulse_glib/proplist.h +++ b/src/lua_libpulse_glib/proplist.h @@ -310,7 +310,9 @@ static const struct luaU_enumfield proplist_enum[] = { { "FORMAT_RATE", PA_PROP_FORMAT_RATE }, { "FORMAT_CHANNELS", PA_PROP_FORMAT_CHANNELS }, { "FORMAT_CHANNEL_MAP", PA_PROP_FORMAT_CHANNEL_MAP }, +#if PA_CHECK_VERSION(15, 0, 0) { "CONTEXT_FORCE_DISABLE_SHM", PA_PROP_CONTEXT_FORCE_DISABLE_SHM }, { "BLUETOOTH_CODEC", PA_PROP_BLUETOOTH_CODEC }, +#endif { NULL, NULL } };