Skip to content

Commit

Permalink
Merge pull request #11 from AlvinSchiller/develop
Browse files Browse the repository at this point in the history
TEST MERGE to master
  • Loading branch information
AlvinSchiller committed Dec 19, 2023
2 parents 28e9f1a + 027a6ad commit 78d4928
Show file tree
Hide file tree
Showing 157 changed files with 2,866 additions and 10,329 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*/temp*
*/*/temp*
*.md
.git
.github
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.{js,yaml,yml}]
indent_size = 2
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/components/controls/buttons_usb_encoder/ @jeripeierSBB
/scripts/installscripts/buster-install-default.sh @jeripeierSBB
/scripts/installscripts/buster-install-default-with-autohotspot.sh @jeripeierSBB
/components/synchronisation/sync-shared @AlvinSchiller
/scripts/installscripts/install-jukebox.sh @jeripeierSBB
/scripts/helperscripts/setup_autohotspot.sh @Groovylein
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ labels: bug, needs triage
### What I did

<!--
i.e. `I installed the raspberry pi with above mentioned buster image and ran the installer script`
i.e. `I installed the raspberry pi with below mentioned image and ran the installer script`
-->

### What happened
Expand Down Expand Up @@ -56,7 +56,7 @@ the following command will help with that
### Installscript

<!--
i.e. `scripts/installscripts/buster-install-default.sh`
i.e. `scripts/installscripts/install-jukebox.sh`
-->


Expand Down
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 🤔 Questions and Help
url: https://github.com/MiczFlor/RPi-Jukebox-RFID/discussions/new?category=q-a
about: This issue tracker is not for support questions. Please refer to our Discussions.
- name: 💬 Chat
url: https://matrix.to/#/#phoniebox_community:gitter.im
about: Want to discuss with others? Check out our chat.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ updates:
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/dockerimage.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PHP Composer

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP with XDebug
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
coverage: xdebug
tools: composer

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: composer run-script test # run not all tests, see composer.json
23 changes: 20 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -40,4 +40,21 @@ jobs:
working-directory: ./components/gpio_control
run: |
pip install -r requirements.txt
pytest
pytest --cov --cov-report xml
- name: Report to Coveralls (parallel)
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./components/gpio_control/coverage.xml
format: cobertura
parallel: true

finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
#carryforward: "run-1,run-2"
58 changes: 0 additions & 58 deletions .github/workflows/pythonpackage_future3.yml

This file was deleted.

97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release

on:
push:
branches:
- 'master'

jobs:

check:
# TODO remove test code
if: ${{ github.repository_owner == 'MiczFlor' || github.repository_owner == 'AlvinSchiller' }}
runs-on: ubuntu-latest

outputs:
tag_name: ${{ steps.vars.outputs.tag_name }}
release_type: ${{ steps.vars.outputs.release_type }}
check_abort: ${{ steps.vars.outputs.check_abort }}

steps:
- uses: actions/checkout@v3

- name: Set Output vars
id: vars
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
# Official SemVer Regex definition
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# Needed changes to the regex:
# - '?:' capture command needed to be removed as it wasn't working in shell
# - '\d' had to be replaced with [0-9]
#
# Release versions like 1.0.0, 3.5.0, 100.4.50000+metadata
REGEX_VERSION_RELEASE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"
#
# Prerelease versions like 1.0.0-alpha, 3.5.0-whatsoever.12, 100.4.50000-identifier.12+metadata
REGEX_VERSION_PRERELEASE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"
# Get the version and calculate release type
VERSION=$(cat ./settings/version-number)
if echo "$VERSION" | grep -qoE "$REGEX_VERSION_RELEASE" ; then
RELEASE_TYPE=release
elif echo "$VERSION" | grep -qoE "$REGEX_VERSION_PRERELEASE" ; then
RELEASE_TYPE=prerelease
else
RELEASE_TYPE=none
fi
if [ "$BRANCH_NAME" == 'master' -a "$RELEASE_TYPE" == 'release' ] ; then
CHECK_ABORT=false
else
echo "::notice title=Abort due to not matching ${RELEASE_TYPE} version for branch!::'${VERSION}' on '${BRANCH_NAME}'"
CHECK_ABORT=true
fi
echo "::group::Output values"
echo "Version: ${VERSION}"
echo "RELEASE_TYPE: ${RELEASE_TYPE}"
echo "BRANCH_NAME: ${BRANCH_NAME}"
echo "CHECK_ABORT: ${CHECK_ABORT}"
echo "tag_name=v${VERSION}" >> $GITHUB_OUTPUT
echo "release_type=${RELEASE_TYPE}" >> $GITHUB_OUTPUT
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "check_abort=${CHECK_ABORT}" >> $GITHUB_OUTPUT
echo "::endgroup::"
release:
needs: [check]
if: ${{ needs.check.outputs.check_abort == 'false' }}
runs-on: ubuntu-latest

concurrency:
group: ${{ needs.check.outputs.tag_name }}

permissions:
contents: write

steps:
- name: Create Release
uses: ncipollo/release-action@v1
with:
commit: ${{ github.sha }}
tag: ${{ needs.check.outputs.tag_name }}
body: "Automated Release for ${{ needs.check.outputs.tag_name }}"
makeLatest: ${{ needs.check.outputs.release_type == 'release' }}
prerelease: ${{ needs.check.outputs.release_type == 'prerelease' }}
generateReleaseNotes: ${{ needs.check.outputs.release_type == 'release' }}
skipIfReleaseExists: false
allowUpdates: true
removeArtifacts: false
replacesArtifacts: false
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/test_docker_debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test Install Scripts Debian

on:
schedule:
# run at 5:00 every sunday
- cron: '0 5 * * 0'
push:
branches-ignore:
- 'future3/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]

# let only one instance run the test so cache is not corrupted.
# cancel already running instances as only the last run will be relevant
concurrency:
group: ${{ github.ref }}-test-debian
cancel-in-progress: true

jobs:

# Build container and run tests
run:
name: ${{ matrix.debian_codename }}
strategy:
fail-fast: false
matrix:
debian_codename: ['bookworm', 'bullseye', 'buster']
uses: ./.github/workflows/test_docker_debian_codename_sub.yml
with:
runs_on: ubuntu-latest
platform: linux/arm/v7
docker_image_name: rpi-jukebox-rfid
cache_scope: ${{ github.ref }}-test-debian
matrix_usernames: "['pi', 'hans']"
matrix_test_scripts: "['run_installation_tests.sh', 'run_installation_tests2.sh', 'run_installation_tests3.sh']"
debian_codename: ${{ matrix.debian_codename }}
Loading

0 comments on commit 78d4928

Please sign in to comment.