Skip to content

Commit 488667e

Browse files
authored
Merge pull request #46 from OpenLightingProject/0.10
0.10
2 parents 688cfe1 + 6c39ef9 commit 488667e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4141
-208
lines changed

.codespellignorelines

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
/(?:([0-9]{1,3})(?:\s+THRU\s+([0-9]{0,3}))?)(?:\s+@\s+([0-9]{0,3}))?$/);
1818
str = str.replace('>', 'THRU');
1919
' THRU ' + ola.common.DmxConstants.MAX_CHANNEL_NUMBER);
20-
' THRU ' + ola.common.DmxConstants.MAX_CHANNEL_NUMBER);
2120
// If it's the T or > keys, autocomplete 'THRU'
2221
case 'U': // THRU
2322
var values = ['7', '8', '9', ' THRU ', '4', '5', '6', ' @ ', '1', '2', '3',
@@ -118,9 +117,6 @@ class AsyncronousLibUsbAdaptor : public BaseLibUsbAdaptor {
118117
OLA_ASSERT_EQ(expected, JsonWriter::AsString(uint_value));
119118
* Test the uint item
120119
" \"type\": \"uint\",\n"
121-
" \"type\": \"uint\",\n"
122-
" \"type\": \"uint\",\n"
123-
" \"type\": \"uint\",\n"
124120
std::map<std::string, UIntMap*> m_uint_map_variables;
125121
if (message.uint_offset < MAX_UINT_FIELDS) {
126122
message.uint16_fields[message.uint_offset++] = field->Value();
@@ -131,10 +127,8 @@ class AsyncronousLibUsbAdaptor : public BaseLibUsbAdaptor {
131127
status_message() : uint_offset(0), int_offset(0), status_type(0),
132128
std::string Type() const { return "uint"; }
133129
if (items[i]['type'] == 'uint') {
134-
if (items[i]['type'] == 'uint') {
135130
if (type == 'string' || type == 'uint' || type == 'hidden') {
136131
const char RDMHTTPModule::GENERIC_UINT_FIELD[] = "int";
137-
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
138132
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
139133
SelectItem *item = new SelectItem("Personality", GENERIC_UINT_FIELD);
140134
string personality_str = request->GetParameter(GENERIC_UINT_FIELD);
@@ -198,4 +192,8 @@ import java.nio.ByteOrder;
198192
"{'a': 'caf\\\\xe9'}")
199193
# self.assertEqual('%s' % rtf._EscapeData({"caf\xe9": "bar"}),
200194
# "{'caf\xe9': 'bar'}")
195+
self.assertEqual('caf\\xe9', StringEscape(u'caf\xe9'))
196+
self.assertEqual('caf\\xe9', ("%s" % StringEscape(u'caf\xe9')))
201197
"forin": true,
198+
dcmd mv ../*ges built/
199+
run: autopkgtest --output-dir=test-output built/*ges -- null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "build-verify-trees",
5+
"severity": "error",
6+
"pattern": [
7+
{
8+
"regexp": "^(Missing from tarball)(\\s+)(.+)$",
9+
"message": 1,
10+
"file": 3
11+
}
12+
]
13+
}
14+
]
15+
}

.github/workflows/annotation.yml

-14
This file was deleted.

.github/workflows/build.yaml

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
name: build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
name: "${{ matrix.id }}"
6+
runs-on: ubuntu-latest
7+
container: ${{ matrix.container }}
8+
timeout-minutes: 360
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- id: "coverage-debian-stable-amd64-gcc"
14+
task: "coverage"
15+
configure-args: "--enable-ja-rule --enable-e133 --enable-unittests --enable-gcov"
16+
# TODO(Perry): Fix Debian 12 OOM issue on GitHub Actions
17+
container: "debian:stable"
18+
compiler:
19+
CC: "/usr/bin/gcc"
20+
CXX: "/usr/bin/g++"
21+
pkg: "gcc g++"
22+
- id: "distcheck-debian-stable-amd64-gcc"
23+
task: "distcheck"
24+
configure-args: "--enable-ja-rule --enable-e133 --enable-rdm-tests --enable-java-libs"
25+
# TODO(Perry): Fix Debian 12 OOM issue on GitHub Actions
26+
container: "debian:stable"
27+
compiler:
28+
CC: "/usr/bin/gcc"
29+
CXX: "/usr/bin/g++"
30+
pkg: "gcc g++"
31+
- id: "distcheck-debian-stable-amd64-clang"
32+
task: "distcheck"
33+
configure-args: "--enable-ja-rule --enable-e133 --enable-rdm-tests --enable-java-libs"
34+
# TODO(Perry): Fix Debian 12 OOM issue on GitHub Actions
35+
container: "debian:stable"
36+
compiler:
37+
CC: "/usr/bin/clang"
38+
CXX: "/usr/bin/clang++"
39+
pkg: "clang"
40+
env:
41+
CC: "${{ matrix.compiler.CC }}"
42+
CXX: "${{ matrix.compiler.CXX }}"
43+
steps:
44+
- name: Get number of CPU cores
45+
id: num-cpu-cores
46+
# TODO(Perry): Parallelization causes GH Actions to hang -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }}
47+
# run: echo "NUM_CPU_CORES=$(grep -c processor /proc/cpuinfo)" >> $GITHUB_OUTPUT
48+
run: echo "NUM_CPU_CORES=1" >> $GITHUB_OUTPUT
49+
- name: Update package database
50+
run: apt-get update -y
51+
# See comments beginning at
52+
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
53+
# Without Git, actions/checkout@v3 will resort to REST and will not
54+
# create a .git folder or .git.config. The Problem Matcher looks for
55+
# .git/config to find where the root of the repo is, so it must be
56+
# present.
57+
- name: Install Git
58+
run: apt-get -y install git
59+
- uses: actions/checkout@v3
60+
- name: Install build tools
61+
shell: bash
62+
run: |
63+
apt-get -y install adduser sudo pkg-config libtool autoconf \
64+
automake g++ bison flex make bash-completion dh-autoreconf \
65+
debhelper devscripts wget python3-full python3-pip
66+
- name: Setup Python venv
67+
shell: bash
68+
run: |
69+
python3 -m venv --system-site-packages ../venv
70+
source ../venv/bin/activate
71+
echo "PATH=$PATH" >> $GITHUB_ENV
72+
- name: Install Python build tools
73+
run: python3 -m pip install --no-input gcovr
74+
- name: Install build dependencies
75+
shell: bash
76+
run: |
77+
apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \
78+
libmicrohttpd-dev protobuf-compiler python3-protobuf \
79+
libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \
80+
libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy \
81+
default-jdk-headless maven
82+
- name: Install compiler
83+
shell: bash
84+
run: apt-get -y install ${{ matrix.compiler.pkg }}
85+
- name: Set up build user # CredentialsTest cannot run as root
86+
run: |
87+
adduser --disabled-password --gecos "" builduser
88+
chown -R builduser:builduser .
89+
chown builduser:builduser ..
90+
- name: Autoreconf
91+
run: sudo --preserve-env -u builduser env "PATH=$PATH" autoreconf -i
92+
- name: Set configure arguments
93+
run: |
94+
echo "GH_OLA_CONFIGURE_ARGS=${{ matrix.configure-args }}" >> $GITHUB_ENV
95+
- name: Set additional Linux configure arguments
96+
if: runner.os == 'Linux'
97+
# Silence all deprecated declarations on Linux due to auto_ptr making the build log too long
98+
run: |
99+
echo "GH_OLA_CONFIGURE_ARGS=$GH_OLA_CONFIGURE_ARGS CPPFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV
100+
- name: Print configure command
101+
run: echo "./configure $GH_OLA_CONFIGURE_ARGS"
102+
- name: Configure
103+
run: sudo --preserve-env -u builduser env "PATH=$PATH" ./configure $GH_OLA_CONFIGURE_ARGS
104+
- name: ${{ matrix.task }}
105+
run: sudo --preserve-env -u builduser env "PATH=$PATH" make ${{ matrix.task }} -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} VERBOSE=1
106+
- name: Display structure of the built files
107+
if: always() && env.ACTIONS_STEP_DEBUG == 'true'
108+
run: ls -alR
109+
- name: Archive artifacts to speed up slow GH Actions upload/download
110+
if: always()
111+
shell: bash
112+
# If the file does not exist when tar excludes it, then it will not
113+
# actually exclude it, so it must first be touched
114+
run: |
115+
touch ola-${{ matrix.id }}-source-tree.tar.gz
116+
tar --exclude=ola-${{ matrix.id }}-source-tree.tar.gz -cvzf ola-${{ matrix.id }}-source-tree.tar.gz .
117+
- name: SHA256 artifact archives
118+
if: always()
119+
run: sha256sum ola-*.tar.gz
120+
- name: Upload source tree artifact
121+
uses: actions/upload-artifact@v3
122+
if: always()
123+
with:
124+
name: ola-${{ matrix.id }}-source-tree
125+
path: ola-${{ matrix.id }}-source-tree.tar.gz
126+
- name: Upload built artifact
127+
if: matrix.task == 'distcheck' || matrix.task == 'dist'
128+
uses: actions/upload-artifact@v3
129+
with:
130+
name: ola-${{ matrix.id }}-dist
131+
path: |
132+
ola-*.tar.gz
133+
!ola-${{ matrix.id }}-source-tree.tar.gz
134+
- name: Install coverage tools
135+
if: matrix.task == 'coverage'
136+
run: apt-get -y install curl
137+
- name: Upload coverage to Coveralls
138+
if: matrix.task == 'coverage'
139+
uses: coverallsapp/github-action@v2
140+
with:
141+
# Coveralls GitHub action does not support its own format
142+
# see: https://github.com/coverallsapp/github-action/issues/104
143+
# file: coverage/coverage.coveralls.json
144+
file: coverage/coverage.cobertura.xml
145+
format: cobertura
146+
flag-name: ${{ matrix.id }}
147+
- name: Upload coverage artifacts
148+
if: always() && matrix.task == 'coverage'
149+
uses: actions/upload-artifact@v3
150+
with:
151+
name: ola-${{ matrix.id }}-coverage
152+
path: coverage/
153+
verify-trees:
154+
name: 'Verify trees for ${{ matrix.id }}'
155+
needs: build
156+
if: "always()" # Run if some builds fail but ensure they all complete first
157+
container: debian:stable
158+
runs-on: ubuntu-latest
159+
strategy:
160+
fail-fast: false
161+
matrix:
162+
include:
163+
- id: "distcheck-debian-stable-amd64-gcc"
164+
- id: "distcheck-debian-stable-amd64-clang"
165+
steps:
166+
- name: Download built source tree archive
167+
uses: actions/download-artifact@v3
168+
with:
169+
name: ola-${{ matrix.id }}-source-tree
170+
path: .
171+
- name: SHA256 artifact archive
172+
run: sha256sum ola-${{ matrix.id }}-source-tree.tar.gz
173+
- name: Unarchive artifacts and delete archive
174+
shell: bash
175+
run: |
176+
tar -xvzf ola-${{ matrix.id }}-source-tree.tar.gz .
177+
rm ola-${{ matrix.id }}-source-tree.tar.gz
178+
- name: Display structure of extracted files
179+
if: env.ACTIONS_STEP_DEBUG == 'true'
180+
run: ls -alR
181+
- name: Update package database
182+
run: apt-get update -y
183+
- name: Install Python
184+
run: apt-get -y install python3 python-is-python3
185+
# TODO(Perry): Disable problem matcher for now until verify trees is fixed
186+
# - name: Enable Problem Matcher for GitHub annotations
187+
# run: echo "::add-matcher::.github/problem-matcher-build-verify-trees.json"
188+
- name: Find dist build tarball
189+
run: |
190+
echo "GH_OLA_VERIFY_TREES_TARBALL=$(ls -t --time=birth ola*.tar.gz| head -1)" >> $GITHUB_ENV
191+
- name: Print dist build tarball name
192+
run: echo "$GH_OLA_VERIFY_TREES_TARBALL"
193+
- name: Extract dist build
194+
run: tar -xvzf $GH_OLA_VERIFY_TREES_TARBALL
195+
- name: Verify trees
196+
shell: bash
197+
# TODO(Perry): Always succeed for now until verify trees is fixed
198+
# run: ./scripts/verify_trees.py ./ $(echo $GH_OLA_VERIFY_TREES_TARBALL | sed 's/.tar.gz$//')
199+
run: "./scripts/verify_trees.py ./ $(echo $GH_OLA_VERIFY_TREES_TARBALL | sed 's/.tar.gz$//') || true"

.github/workflows/debian.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This action originally modeled off of the Debian build action:
2+
# https://salsa.debian.org/wouter/ola/-/blob/a38a396f6994b2b1af8efec9e208aee4e67f77aa/.gitlab-ci.yml
3+
4+
name: debian
5+
on: [push, pull_request]
6+
jobs:
7+
debian-build:
8+
name: 'Debian Build ${{ matrix.image_tag }} ${{ matrix.architecture }}'
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
image_tag: [bullseye, bookworm, trixie, sid]
14+
architecture: [amd64]
15+
container: debian:${{ matrix.image_tag }}
16+
steps:
17+
- name: Get number of CPU cores
18+
run: echo "NUM_CPU_CORES=$(grep -c processor /proc/cpuinfo)" >> $GITHUB_OUTPUT
19+
id: num-cpu-cores
20+
- name: Update package database
21+
run: apt-get update -y
22+
# See comments beginning at
23+
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
24+
# Without Git, actions/checkout@v3 will resort to REST and will not
25+
# create a .git folder or .git.config. The Problem Matcher looks for
26+
# .git/config to find where the root of the repo is, so it must be
27+
# present.
28+
- name: Install Git
29+
run: apt-get -y install git
30+
- uses: actions/checkout@v3
31+
- name: Install build tools
32+
run: apt-get -y install devscripts adduser fakeroot sudo
33+
- name: Install build dependencies
34+
run: mk-build-deps -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends" -i -r
35+
- name: Set up build user
36+
run: |
37+
adduser --disabled-password --gecos "" builduser
38+
chown -R builduser:builduser .
39+
chown builduser:builduser ..
40+
- name: Build
41+
run: sudo -u builduser dpkg-buildpackage -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }}
42+
- name: Move built files
43+
if: always()
44+
run: |
45+
mkdir built
46+
dcmd mv ../*ges built/
47+
- name: Display structure of built files
48+
if: always()
49+
run: ls -alR
50+
working-directory: built
51+
- name: SHA256 built files
52+
if: always()
53+
shell: bash
54+
run: find . -type f -exec sha256sum {} \;
55+
working-directory: built
56+
- uses: actions/upload-artifact@v3
57+
if: always()
58+
with:
59+
name: ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
60+
path: ./built
61+
debian-test:
62+
name: 'Debian Test ${{ matrix.image_tag }} ${{ matrix.architecture }}'
63+
needs: debian-build
64+
if: "always()" # Run if some builds fail but ensure they all complete first
65+
runs-on: ubuntu-latest
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
image_tag: [bullseye, bookworm, trixie, sid]
70+
architecture: [amd64]
71+
container: debian:${{ matrix.image_tag }}
72+
steps:
73+
- uses: actions/checkout@master
74+
- name: Download build artifact
75+
uses: actions/download-artifact@v3
76+
with:
77+
name: ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
78+
path: built
79+
- name: Display structure of artifact files
80+
run: ls -alR
81+
working-directory: built
82+
- name: Update package database
83+
run: apt-get update -y
84+
- name: Install test tools
85+
run: apt-get -y install autopkgtest
86+
- name: Test
87+
run: autopkgtest --output-dir=test-output built/*ges -- null
88+
- uses: actions/upload-artifact@v3
89+
if: always() # Always upload the test output, even on failed tests
90+
with:
91+
name: ola-test-output-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
92+
path: test-output

0 commit comments

Comments
 (0)