Skip to content

Commit

Permalink
New Release: v0.13.0 (#331)
Browse files Browse the repository at this point in the history
Happy new year!
  • Loading branch information
simonmicro authored Jan 1, 2023
2 parents 0a71a6d + ce56b8b commit ad3c8f8
Show file tree
Hide file tree
Showing 186 changed files with 5,062 additions and 786 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ src/swig/*.cpp linguist-vendored
src/swig/*.h linguist-vendored
src/swig/*.cxx linguist-vendored
include/assets/*.h linguist-vendored
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
7 changes: 5 additions & 2 deletions .github/buildEverything.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ def doBuild(makeDebug):
exit(2)
# "Export" firmware.bin
shutil.copy(os.path.join('.pio', 'build', edition, 'firmware.bin'), os.path.join('.', filename))
doBuild(True)
doBuild(False)
if str(args["support_build"]) == "" or str(args["support_build"]) == "debug":
doBuild(True)
if str(args["support_build"]) == "" or str(args["support_build"]) == "release":
doBuild(False)

if __name__ == "__main__":

Expand All @@ -92,6 +94,7 @@ def doBuild(makeDebug):
ap.add_argument("-l", "--support-language", type=str, required=True, help="# model language to compile. (Enter 'all' to compile all language packs.)")
ap.add_argument("-m", "--support-model", type=str, required=True, help="# model type to compile. (Enter 'all' to compile all model packs.)")
ap.add_argument("-f", "--support-feature", type=str, required=False, default="", help="# feature to compile. (Enter a feature to compile.)")
ap.add_argument("-b", "--support-build", type=str, required=False, default="", help="# Build configuration to compile. (Enter a Debug/Release to compile.)")
args = vars(ap.parse_args())

if str(args["support_feature"]) != "":
Expand Down
6 changes: 3 additions & 3 deletions .github/setMatrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ elif [ "$1" = "--default-mod" ]; then
echo $(X=$(X=$(cat platformio.ini | grep "defau"); echo "${X:15}");X=($X);jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
elif [ "$1" = "--get-flag" ]; then
# get_flag
echo $(X=$(curl https://api.github.com/repos/Open-smartwatch/open-smartwatch.github.io/contents/docs/resources/firmware.md | jq -r ".content" | base64 --decode | grep -o '^-.*` |'); X=$(echo $X | tr '` |-' ' ');X=($X);jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
echo $(X=$(cat docs/firmware/osw_os.md | grep -o '^-.*` |'); X=$(echo $X | tr '` |-' ' ');X=($X);jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
elif [ "$1" = "--get-models" ]; then
# get_models
echo $(X=$(cat platformio.ini | grep "\[\env:" | sed -e 's/\[\env://' | tr ']\n' ' ');X=($X);jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
echo $(X=$(cat platformio.ini | grep "\[\env:" | grep -v "GPS" | sed -e 's/\[\env://' | tr ']\n' ' ');X=($X);jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
elif [ "$1" = "--get-languages" ]; then
# get_languages
echo $(cd include/locales/; X=$(ls *.h -1 | sed -e 's/\.h$//' | tr '\n' ' ');X=($X);jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
else
echo "Try, again ! $(date +%F)"
exit 1
fi
fi
7 changes: 4 additions & 3 deletions .github/workflows/astyle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests/
name: Format Source Code

name: auto-format
on:
# pull_request would be OK, but will ignore direct pushes to the master (which can't be protected on private repos) - therefore just run it always (force-push as you wish on your private branches)
push:
Expand All @@ -10,6 +10,7 @@ on:
jobs:
format:
runs-on: ubuntu-latest
if: ${{ github.repository == 'Open-Smartwatch/open-smartwatch-os' }}
steps:
- uses: actions/checkout@v1
with:
Expand All @@ -22,7 +23,7 @@ jobs:
run: astyle --style=google --recursive /workspace/*.c,*.cc,*.cpp,*.h,*.hpp --suffix=none --indent=spaces --align-pointer=type --align-reference=type --convert-tabs --preserve-date --lineend=linux
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo 'false'; else echo 'true'; fi)" >> $GITHUB_OUTPUT
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
Expand All @@ -33,4 +34,4 @@ jobs:
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
branch: ${{ github.ref }}
44 changes: 44 additions & 0 deletions .github/workflows/test-EMULATOR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build OSW Emulator (Ubuntu)

on:
push:
paths_ignore: '["**/*.md", "**/scripts/screen_capture/**"]'
pull_request:
branches: [ master, develop ]

jobs:
check_skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'

build-EMULATOR:
runs-on: ubuntu-22.04
needs: check_skip
if: ${{ needs.check_skip.outputs.should_skip != 'true' }}
strategy:
matrix:
build-configuration: [Debug, Release]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update packages
run: sudo apt-get update && sudo apt-get upgrade -y
- name: Install packages
run: sudo apt-get -y install gcc g++ cmake libsdl2-dev libsdl2-image-dev
- name: Create build directory
run: mkdir build
- name: CMake ${{ matrix.build-configuration }}
run: cd build && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-configuration }} ..
- name: Make
run: cd build && make -j $(nproc)
- name: Test
run: cd build && make test
45 changes: 29 additions & 16 deletions .github/workflows/test-FEATURE.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
name: OSW-FEATURE-test
name: Build OSW-OS (Ubuntu, additional features)

on:
workflow_dispatch:
push:
paths_ignore: '["*.md", "**/scripts/screen_capture/**"]'
pull_request:
branches: [ master, develop ]

jobs:
Find-feature:
check_skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'

Find-feature:
runs-on: ubuntu-latest
needs: check_skip
if: ${{ needs.check_skip.outputs.should_skip != 'true' }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- id: get-flag
run: |
echo "::set-output name=feature::$(./.github/setMatrix.sh --get-flag)"
echo "feature=$(./.github/setMatrix.sh --get-flag)" >> $GITHUB_OUTPUT
- id: default_mod
run: |
echo "::set-output name=default_model::$(./.github/setMatrix.sh --default-mod)"
echo "default_model=$(./.github/setMatrix.sh --default-mod)" >> $GITHUB_OUTPUT
- id: default_lang
run: |
echo "::set-output name=default_language::$(./.github/setMatrix.sh --default-lang)"
echo "default_language=$(./.github/setMatrix.sh --default-lang)" >> $GITHUB_OUTPUT
outputs:
feature: ${{ steps.get-flag.outputs.feature }}
default_model: ${{ steps.default_mod.outputs.default_model }}
Expand All @@ -38,28 +51,28 @@ jobs:
language: ${{ fromJson(needs.Find-feature.outputs.default_language) }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: cache-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
key: pip-${{ runner.os }}
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.platformio
key: cache-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
key: platformio-${{ runner.os }}
- name: Install swig
run: sudo apt-get update && sudo apt-get -y install swig
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PlatformIO
run: python -m pip install --upgrade pip && pip install --upgrade platformio
- name: Rename config
run: mv include/config.h.example include/config.h
- name: Compile language ${{ matrix.language }} model ${{ matrix.model }} feature ${{ matrix.feature }}
run: python3 .github/buildEverything.py -l ${{ matrix.language }} -m ${{ matrix.model }} -f ${{ matrix.feature }}
run: python3 .github/buildEverything.py -l ${{ matrix.language }} -m ${{ matrix.model }} -f ${{ matrix.feature }} -b debug
74 changes: 74 additions & 0 deletions .github/workflows/test-OS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build OSW-OS (Ubuntu, Windows, Mac OS, all models)

on:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
Find-feature:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- uses: dorny/[email protected]
id: filter
with:
filters: |
i8n:
- 'include/locales/*.h'
- id: get_lang
run: |
if [ ${{ steps.filter.outputs.i8n }} == "true" ]; then
echo "get-languages=$(./.github/setMatrix.sh --get-languages)" >> $GITHUB_OUTPUT
else
echo "get-languages=$(./.github/setMatrix.sh --default-lang)" >> $GITHUB_OUTPUT
fi
- id: get_mod
run: |
echo "get-models=$(./.github/setMatrix.sh --get-models)" >> $GITHUB_OUTPUT
outputs:
get-models: ${{ steps.get_mod.outputs.get-models }}
get-languages: ${{ steps.get_lang.outputs.get-languages }}
build-OSW:
needs: Find-feature
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
model: ${{ fromJson(needs.Find-feature.outputs.get-models) }}
language: ${{ fromJson(needs.Find-feature.outputs.get-languages) }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: platformio-${{ runner.os }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install PlatformIO
shell: bash
run: |
apt update && apt -y install swig
python -m pip install --upgrade pip
pip install --upgrade platformio
mv include/config.h.example include/config.h
- name: Compile language ${{ matrix.language }} model ${{ matrix.model }}
run: python3 .github/buildEverything.py -l ${{ matrix.language }} -m ${{ matrix.model }} -b debug
56 changes: 41 additions & 15 deletions .github/workflows/test-OSW.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
name: OSW-OS-test
name: Build OSW-OS (Ubuntu, all models)

on:
workflow_dispatch:
push:
paths_ignore: '["*.md", "**/scripts/screen_capture/**"]'
pull_request:
branches: [ master, develop ]

jobs:
Find-packages:
check_skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'

Find-packages:
runs-on: ubuntu-latest
needs: check_skip
if: ${{ needs.check_skip.outputs.should_skip != 'true' }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- uses: dorny/[email protected]
id: filter
with:
filters: |
i8n:
- 'include/locales/*.h'
- id: get-languages
run: echo "::set-output name=languages_matrix::$(./.github/setMatrix.sh --get-languages)"
run: |
if [ "${{ steps.filter.outputs.i8n }}" == "true" -o "${{ github.head_ref == 'master' }}" == "true" -o "${{ github.base_ref == 'master' }}" == "true" ]; then
echo "languages_matrix=$(./.github/setMatrix.sh --get-languages)" >> $GITHUB_OUTPUT
else
echo "languages_matrix=$(./.github/setMatrix.sh --default-lang)" >> $GITHUB_OUTPUT
fi
- id: get-models
run: echo "::set-output name=models_matrix::$(./.github/setMatrix.sh --get-models)"
run: echo "models_matrix=$(./.github/setMatrix.sh --get-models)" >> $GITHUB_OUTPUT
outputs:
languages_matrix: ${{ steps.get-languages.outputs.languages_matrix }}
models_matrix: ${{ steps.get-models.outputs.models_matrix }}
Expand All @@ -29,35 +54,36 @@ jobs:
matrix:
language: ${{ fromJson(needs.Find-packages.outputs.languages_matrix) }}
model: ${{ fromJson(needs.Find-packages.outputs.models_matrix) }}
build-configuration: [debug, release]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: cache-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
key: pip-${{ runner.os }}
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.platformio
key: cache-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
key: platformio-${{ runner.os }}
- name: Install swig
run: sudo apt-get update && sudo apt-get -y install swig
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PlatformIO
run: python -m pip install --upgrade pip && pip install --upgrade platformio
- name: Rename config
run: mv include/config.h.example include/config.h
- name: Compile language ${{ matrix.language }} model ${{ matrix.model }}
run: python3 .github/buildEverything.py -l ${{ matrix.language }} -m ${{ matrix.model }}
run: python3 .github/buildEverything.py -l ${{ matrix.language }} -m ${{ matrix.model }} -b ${{ matrix.build-configuration }}
- name: Upload firmware artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: firmwares
path: |
Expand Down
Loading

0 comments on commit ad3c8f8

Please sign in to comment.