wip: CI
This commit is contained in:
parent
1745e5d4ad
commit
9c198f1109
6 changed files with 147 additions and 5 deletions
53
.ci/pipeline.yml
Normal file
53
.ci/pipeline.yml
Normal file
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
resources:
|
||||
- name: repo
|
||||
type: git
|
||||
icon: github
|
||||
source:
|
||||
uri: https://git.sclu1034.dev/lucas/lgi-libpulse-glib.git
|
||||
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
|
17
.ci/rock.sh
Executable file
17
.ci/rock.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
sudo enable-lua ${LUA_VERSION:-5.1}
|
||||
eval "$(luarocks --lua-version ${LUA_VERSION:-5.1} path)"
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends gobject-introspection libgirepository1.0-dev libpulse-dev
|
||||
|
||||
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/lgi-libpulse-glib-scm-1.rockspec
|
||||
|
||||
sudo disable-lua ${LUA_VERSION:-5.1}
|
20
.ci/rock.yml
Normal file
20
.ci/rock.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
---
|
||||
platform: linux
|
||||
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: registry.local:5000/lua-clib-x11
|
||||
tag: latest
|
||||
|
||||
inputs:
|
||||
- name: repo
|
||||
|
||||
params:
|
||||
CI: true
|
||||
LUA_VERSION: ((lua-version))
|
||||
|
||||
run:
|
||||
path: .ci/rock.sh
|
||||
dir: repo
|
34
.ci/test.sh
Executable file
34
.ci/test.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/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)"
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends gobject-introspection libgirepository1.0-dev libpulse-dev
|
||||
|
||||
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
|
||||
|
||||
cmake -S "${SOURCE_DIR:-./}" -B "${BUILD_DIR:-./build}" ${CMAKE_ARGS}
|
||||
make -j $(nproc) -C "${BUILD_DIR:-./build}"
|
||||
|
||||
busted \
|
||||
--lua /usr/bin/lua \
|
||||
-C "${SOURCE_DIR:-./}" \
|
||||
"--config-file=${SOURCE_DIR:-./}/.busted.lua" \
|
||||
"--cpath=${BUILD_DIR:-./build}/?.so" \
|
||||
--output=TAP
|
||||
|
||||
sudo disable-lua ${LUA_VERSION:-5.1}
|
20
.ci/test.yml
Normal file
20
.ci/test.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
platform: linux
|
||||
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: registry.local:5000/lua-clib-x11
|
||||
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
|
|
@ -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}]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue