Skip to content

Commit d880d46

Browse files
committed
Merge branch 'future3/develop' into future3/multi-player
2 parents d38dc0c + 3865c5a commit d880d46

File tree

174 files changed

+10680
-2053
lines changed

Some content is hidden

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

174 files changed

+10680
-2053
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ shared
1414
src/webapp/node_modules
1515
src/webapp/npm-debug.log
1616
src/webapp/build
17+
src/webapp/build.bak

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[flake8]
22
max-line-length = 127
33
ignore =
4+
# continuation line over-indented for hanging indent
5+
E126,
46
# continuation line over-indented for visual indent
57
E127,
68
# continuation line under-indented for visual indent

.githooks/post-merge

+20-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# TO ACTIVATE: cp .githooks/post-merge .git/hooks/.
66
#
77
# Checks:
8-
# - Changes to web app
8+
# - Changes to Web App
99
# - Changes to web dependency
1010
# - Changes to python requirements
1111
#
@@ -20,7 +20,7 @@ warn_npm_dependency() {
2020
echo "************************************************************"
2121
echo "ATTENTION: npm dependencies have changed since last pull!"
2222
echo ""
23-
echo "To update dependencies and rebuilt WebApp run:"
23+
echo "To update dependencies and rebuilt Web App run:"
2424
echo "$ cd src/webapp && ./run_rebuild.sh -u"
2525
echo "************************************************************"
2626
echo -e "\n"
@@ -31,7 +31,7 @@ warn_webapp() {
3131
echo "************************************************************"
3232
echo "ATTENTION: Web App sources have changed since last pull!"
3333
echo ""
34-
echo "To rebuilt the WebApp run:"
34+
echo "To rebuilt the Web App run:"
3535
echo "$ cd src/webapp && ./run_rebuild.sh"
3636
echo "************************************************************"
3737
echo -e "\n"
@@ -43,6 +43,7 @@ warn_python_requirements() {
4343
echo "ATTENTION: Python requirements have changed since last pull!"
4444
echo ""
4545
echo "To update python requirements on the RPi run"
46+
echo "$ source .venv/bin/activate"
4647
echo "$ python -m pip install --upgrade -r requirements.txt"
4748
echo "************************************************************"
4849
echo -e "\n"
@@ -57,14 +58,25 @@ warn_githooks() {
5758
echo "$ cp .githooks/* .git/hooks/."
5859
echo "************************************************************"
5960
echo -e "\n"
61+
}
6062

63+
warn_installer() {
64+
echo -e "\n"
65+
echo "************************************************************"
66+
echo "ATTENTION: Installer sources have changed since last pull!"
67+
echo ""
68+
echo "Rerun the installer to apply changes"
69+
echo "$ ./installation/install-jukebox.sh"
70+
echo "************************************************************"
71+
echo -e "\n"
6172
}
6273

6374
# files_changed="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
6475
webapp_changed="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD src/webapp)"
6576
webapp_dep_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD src/webapp/package.json)"
6677
python_req_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD requirements.txt)"
6778
githooks_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD .githooks)"
79+
installer_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD installation)"
6880

6981
if [[ -n $python_req_changed ]]; then
7082
warn_python_requirements
@@ -80,5 +92,9 @@ if [[ -n $githooks_changed ]]; then
8092
warn_githooks
8193
fi
8294

95+
if [[ -n $installer_changed ]]; then
96+
warn_installer
97+
fi
98+
8399
echo -e "\nTo see a summary of what happened since your last pull, do:"
84-
echo -e "git show --oneline -s ORIG_HEAD..HEAD\n"
100+
echo -e "git show --oneline -s ORIG_HEAD..HEAD\n"

.githooks/pre-commit

+30-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
# Checks
88
# - flake8 on staged python files
99
# Note: This only checks the modified files
10-
# - docs build of if any python file or any doc file is staged
10+
# - docs build of if any python file is staged
1111
# Note: This builds the entire documentation if a changed file goes into the documentation
12+
# - Markdownlint if any markdown file is staged
13+
# Note: This checks all markdown files as configured in .markdownlint-cli2.yaml
14+
1215
#
1316
# If there are problem with this script, commit may still be done with
1417
# git commit --no-verify
@@ -28,6 +31,32 @@ fi
2831

2932
code=$(( flake8_code ))
3033

34+
doc_code=0
35+
if [[ -n $PY_FILES ]]; then
36+
echo -e "\n**************************************************************"
37+
echo -e "Modified Python source files. Generation markdown docs from docstring ... \n"
38+
echo -e "**************************************************************\n"
39+
./run_docgeneration.sh -c
40+
doc_code=$?
41+
echo "pydoc_markdown return code: $doc_code"
42+
fi
43+
44+
code=$(( flake8_code + doc_code ))
45+
46+
# Pass all staged markdown files through markdownlint-cli2
47+
MD_FILES="$(git diff --diff-filter=d --staged --name-only -- **/*.md)"
48+
markdownlint_code=0
49+
if [[ -n $MD_FILES ]]; then
50+
echo -e "\n**************************************************************"
51+
echo "Modified Markdown files. Running markdownlint-cli2 ... "
52+
echo -e "**************************************************************\n"
53+
./run_markdownlint.sh
54+
markdownlint_code=$?
55+
echo "Markdownlint-cli2 return code: $markdownlint_code"
56+
fi
57+
58+
code=$(( flake8_code + doc_code + markdownlint_code))
59+
3160
if [[ code -gt 0 ]]; then
3261
echo -e "\n**************************************************************"
3362
echo -e "ERROR(s) during pre-commit checks. Aborting commit!"

.github/ISSUE_TEMPLATE/bug_template.md

-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Please post here the output of 'tail -n 500 /var/log/syslog' or 'journalctl -u m
3333
i.e. `find logfiles at https://paste.ubuntu.com/p/cRS7qM8ZmP/`
3434
-->
3535

36-
3736
## Software
3837

3938
### Base image and version
@@ -59,7 +58,6 @@ the following command will help with that
5958
i.e. `scripts/installscripts/buster-install-default.sh`
6059
-->
6160

62-
6361
## Hardware
6462

6563
### RaspberryPi version
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build Web App
2+
description: 'Build Web App with Node'
3+
inputs:
4+
webapp-root-path:
5+
description: 'root path of the Web App sources'
6+
required: false
7+
default: './src/webapp'
8+
outputs:
9+
webapp-root-path:
10+
description: 'used root path of the Web App sources'
11+
value: ${{ inputs.webapp-root-path }}
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Setup Node.js 20.x
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 20.x
20+
- name: run build
21+
working-directory: ${{ inputs.webapp-root-path }}
22+
shell: bash
23+
env:
24+
CI: false
25+
run: ./run_rebuild.sh -u

.github/workflows/bundle_webapp_and_release_v3.yml

+10-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Bundle Webapp and Release
1+
name: Bundle Web App and Release
22

33
on:
44
push:
@@ -18,7 +18,7 @@ jobs:
1818
check_abort: ${{ steps.vars.outputs.check_abort }}
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222

2323
- name: Set Output vars
2424
id: vars
@@ -72,9 +72,6 @@ jobs:
7272
if: ${{ needs.check.outputs.check_abort == 'false' }}
7373
runs-on: ubuntu-latest
7474

75-
env:
76-
WEBAPP_ROOT_PATH: ./src/webapp
77-
7875
outputs:
7976
tag_name: ${{ needs.check.outputs.tag_name }}
8077
release_type: ${{ needs.check.outputs.release_type }}
@@ -83,7 +80,7 @@ jobs:
8380
webapp_bundle_name_latest: ${{ steps.vars.outputs.webapp_bundle_name_latest }}
8481

8582
steps:
86-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
8784

8885
- name: Set Output vars
8986
id: vars
@@ -94,29 +91,20 @@ jobs:
9491
echo "webapp_bundle_name=webapp-build-${COMMIT_SHA:0:10}.tar.gz" >> $GITHUB_OUTPUT
9592
echo "webapp_bundle_name_latest=webapp-build-latest.tar.gz" >> $GITHUB_OUTPUT
9693
97-
- name: Setup Node.js 20.x
98-
uses: actions/setup-node@v3
99-
with:
100-
node-version: 20.x
101-
- name: npm install
102-
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
103-
run: npm install
104-
- name: npm build
105-
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
106-
env:
107-
CI: false
108-
run: npm run build
94+
- name: Build Web App
95+
id: build-webapp
96+
uses: ./.github/actions/build-webapp
10997

11098
- name: Create Bundle
111-
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
99+
working-directory: ${{ steps.build-webapp.outputs.webapp-root-path }}
112100
run: |
113101
tar -czvf ${{ steps.vars.outputs.webapp_bundle_name }} build
114102
115103
- name: Artifact Upload
116-
uses: actions/upload-artifact@v3
104+
uses: actions/upload-artifact@v4
117105
with:
118106
name: ${{ steps.vars.outputs.webapp_bundle_name }}
119-
path: ${{ env.WEBAPP_ROOT_PATH }}/${{ steps.vars.outputs.webapp_bundle_name }}
107+
path: ${{ steps.build-webapp.outputs.webapp-root-path }}/${{ steps.vars.outputs.webapp_bundle_name }}
120108
retention-days: 5
121109

122110
release:
@@ -131,7 +119,7 @@ jobs:
131119

132120
steps:
133121
- name: Artifact Download
134-
uses: actions/download-artifact@v3
122+
uses: actions/download-artifact@v4
135123
with:
136124
name: ${{ needs.build.outputs.webapp_bundle_name }}
137125

.github/workflows/codeql-analysis_v3.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ jobs:
4444
- name: Install dependencies
4545
run: |
4646
# Install necessary packages
47+
sudo apt-get update
4748
sudo apt-get install libasound2-dev pulseaudio
49+
python3 -m venv .venv
50+
source ".venv/bin/activate"
51+
4852
python -m pip install --upgrade pip
4953
pip install -r requirements.txt
5054
# Set the `CODEQL-PYTHON` environment variable to the Python executable
@@ -53,7 +57,7 @@ jobs:
5357
5458
# Initializes the CodeQL tools for scanning.
5559
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@v2
60+
uses: github/codeql-action/init@v3
5761
with:
5862
languages: ${{ matrix.language }}
5963
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -65,7 +69,7 @@ jobs:
6569
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6670
# If this step fails, then you should remove it and run the build manually (see below)
6771
- name: Autobuild
68-
uses: github/codeql-action/autobuild@v2
72+
uses: github/codeql-action/autobuild@v3
6973

7074
# ℹ️ Command-line programs to run using the OS shell.
7175
# 📚 https://git.io/JvXDl
@@ -79,4 +83,4 @@ jobs:
7983
# make release
8084

8185
- name: Perform CodeQL Analysis
82-
uses: github/codeql-action/analyze@v2
86+
uses: github/codeql-action/analyze@v3

.github/workflows/markdown_v3.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Markdown Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- 'future3/**'
7+
paths:
8+
- '**.md'
9+
pull_request:
10+
branches:
11+
- 'future3/**'
12+
paths:
13+
- '**.md'
14+
15+
jobs:
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Linting markdown
25+
uses: DavidAnson/markdownlint-cli2-action@v15
26+
with:
27+
config: .markdownlint-cli2.yaml
28+
#continue-on-error: true

.github/workflows/pythonpackage_future3.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
max-parallel: 4
2121
matrix:
22-
python-version: ['3.9', '3.10', '3.11']
22+
python-version: ['3.9', '3.10', '3.11', '3.12']
2323

2424
steps:
2525
- uses: actions/checkout@v3
@@ -31,6 +31,9 @@ jobs:
3131
run: |
3232
sudo apt-get update
3333
sudo apt-get install -y libasound2-dev pulseaudio
34+
python3 -m venv .venv
35+
source ".venv/bin/activate"
36+
3437
python3 -m pip install --upgrade pip
3538
pip3 install -r requirements.txt
3639
# For operation of the Jukebox, ZMQ must be compiled from sources due to Websocket support
@@ -51,7 +54,6 @@ jobs:
5154
parallel: true
5255
- name: Lint with flake8
5356
run: |
54-
pip3 install flake8
5557
# Stop the build if linting fails
5658
./run_flake8.sh
5759
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test Build Web App v3
2+
3+
on:
4+
schedule:
5+
# run at 18:00 every sunday
6+
- cron: '0 18 * * 0'
7+
push:
8+
branches:
9+
- 'future3/**'
10+
paths:
11+
- '.github/workflows/test_build_webapp_v3.yml'
12+
- '.github/actions/build-webapp/**'
13+
- 'src/webapp/**'
14+
pull_request:
15+
# The branches below must be a subset of the branches above
16+
branches:
17+
- future3/develop
18+
- future3/main
19+
paths:
20+
- '.github/workflows/test_build_webapp_v3.yml'
21+
- '.github/actions/build-webapp/**'
22+
- 'src/webapp/**'
23+
24+
jobs:
25+
26+
build:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Build Web App
33+
uses: ./.github/actions/build-webapp

0 commit comments

Comments
 (0)