From 6ec06d81e3d720b7d8828144e7e02da0f5f11a7f Mon Sep 17 00:00:00 2001 From: daktak Date: Sat, 7 Aug 2021 14:44:31 +1000 Subject: [PATCH 1/4] Github Actions CI --- .github/workflows/main.yml | 44 ++++++++++++++++++++ Makefile | 85 +++++++++++++++++++++++--------------- 2 files changed, 96 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..12ffcae --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master] + pull_request: + branches: [ master] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-18.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - uses: actions/setup-python@v2 + with: + python-version: '2.7' + - name: apt-get + run: sudo apt-get -qq install -y wget python-pip python2.7-dev libsdl1.2debian libfdt1 libpixman-1-0 nodejs npm libfreetype6 libx11-6 rlwrap + - name: virtualenv + run: pip install virtualenv + - name: get sdk + run: if [ ! -d sdk ]; then mkdir sdk && wget -q -O - https://developer.rebble.io/s3.amazonaws.com/assets.getpebble.com/pebble-tool/pebble-sdk-4.5-linux64.tar.bz2 | tar xj --strip-components=1 -C sdk; fi + - name: requirements + run: if [ ! -d sdk/.env ]; then cd sdk && virtualenv .env && bash -c "source .env/bin/activate && pip install -r requirements.txt && deactivate" && cd ..; fi + - name: sdk-core + run: if [ ! -f sdk/sdk-core-4.3.tar.bz2 ]; then wget https://github.com/aveao/PebbleArchive/raw/master/SDKCores/sdk-core-4.3.tar.bz2 -O sdk/sdk-core-4.3.tar.bz2; fi + - name: install sdk + run: if [ ! -d ~/.pebble-sdk ]; then mkdir -p ~/.pebble-sdk && touch ~/.pebble-sdk/NO_TRACKING && sdk/bin/pebble sdk install sdk/sdk-core-4.3.tar.bz2; fi + - name: make + run: make travis_build diff --git a/Makefile b/Makefile index c348c32..4b9810c 100644 --- a/Makefile +++ b/Makefile @@ -1,40 +1,59 @@ -CONFIG= -CONFIG_VALUE= -ARGS= -MAIL_SUBJECT="" -MAIL_CONTENT="" - -.PHONY: test build config_test screenshots screenshot travis clean wipe - -config_test: - @mkdir -p bin - gcc -std=c99 -g -lcmocka -o bin/config_test -Isrc -Itest src/config.c test/config_test.c -Wl,--wrap=GColorFromHEX -Wl,--wrap=persist_exists -Wl,--wrap=persist_write_data -Wl,--wrap=persist_read_data - valgrind ./bin/config_test --leak-check=full - -screenshots: - rm -Rf screenshots/ - $(MAKE) screenshot CONFIG=CONFIG_DEFAULT - $(MAKE) screenshot CONFIG=CONFIG_MILITARY_TIME CONFIG_VALUE=true - $(MAKE) screenshot CONFIG=CONFIG_DATE_DISPLAYED CONFIG_VALUE=false - $(MAKE) screenshot CONFIG=CONFIG_WEATHER_ENABLED CONFIG_VALUE=false - $(MAKE) screenshot CONFIG=CONFIG_RAINBOW_MODE CONFIG_VALUE=true - $(MAKE) screenshot CONFIG=CONFIG_TEMPERATURE_UNIT CONFIG_VALUE=Fahrenheit - $(MAKE) screenshot CONFIG=CONFIG_BLUETOOTH_ICON CONFIG_VALUE=NoIcon ARGS='NO_BT=1' - $(MAKE) screenshot CONFIG=CONFIG_BLUETOOTH_ICON CONFIG_VALUE=Heart ARGS='NO_BT=1' - pebble kill -screenshot: - yes | $(CONFIG)=$(CONFIG_VALUE) SCREENSHOT=1 $(ARGS) pebble build - scripts/screenshots.sh $(CONFIG)_$(CONFIG_VALUE) +# platform +#P="chalk" + +VERSION=$(shell cat package.json | grep version | grep -o "[0-9][0-9]*\.[0-9][0-9]*") +NAME=$(shell cat package.json | grep '"name":' | head -1 | sed 's/,//g' |sed 's/"//g' | awk '{ print $2 }') + +all: build install + +init_overlays: + mkdir -p resources/data + touch resources/data/OVL_aplite.bin + touch resources/data/OVL_basalt.bin + touch resources/data/OVL_chalk.bin + touch resources/data/OVL_diorite.bin -build: - yes | pebble build +build: init_overlays + pebble build -travis: build +config: + pebble emu-app-config --emulator $(PEBBLE_EMULATOR) + +log: + pebble logs --emulator $(PEBBLE_EMULATOR) + +travis_build: init_overlays + yes | sdk/bin/pebble build + +install: + pebble install --emulator $(PEBBLE_EMULATOR) clean: - rm -Rf bin - yes | pebble clean + pebble clean + +size: + pebble analyze-size + +logs: + pebble logs --emulator $(PEBBLE_EMULATOR) + +phone-logs: + pebble logs --phone ${PEBBLE_PHONE} + +screenshot: + pebble screenshot --phone ${PEBBLE_PHONE} + +deploy: + pebble install --phone ${PEBBLE_PHONE} + +timeline-on: + pebble emu-set-timeline-quick-view on + +timeline-off: + pebble emu-set-timeline-quick-view off wipe: - yes | pebble wipe + pebble wipe + +.PHONY: all build config log install clean size logs screenshot deploy timeline-on timeline-off wipe phone-logs From cd50dac10421adbcb33b90307df514bcd50f6144 Mon Sep 17 00:00:00 2001 From: daktak Date: Tue, 10 Aug 2021 15:58:34 +1000 Subject: [PATCH 2/4] upload pbw --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12ffcae..1cf77c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,3 +42,8 @@ jobs: run: if [ ! -d ~/.pebble-sdk ]; then mkdir -p ~/.pebble-sdk && touch ~/.pebble-sdk/NO_TRACKING && sdk/bin/pebble sdk install sdk/sdk-core-4.3.tar.bz2; fi - name: make run: make travis_build + - name: Upload PBW + uses: actions/upload-artifact@v2 + with: + name: App + path: ${{ github.workspace }}/build/*.pbw From 933d158ec1039165178b25f38260eb6fbd122032 Mon Sep 17 00:00:00 2001 From: Daktak Date: Fri, 10 Oct 2025 15:03:51 +1100 Subject: [PATCH 3/4] sdk update --- .github/workflows/main.yml | 38 ++++++++++++++++---------------------- Makefile | 3 --- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1cf77c3..f7ce3c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [ master] + branches: [ dev,master ] pull_request: - branches: [ master] + branches: [ dev,master ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -18,32 +18,26 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v5 + - uses: actions/setup-python@v5 with: - python-version: '2.7' - - name: apt-get - run: sudo apt-get -qq install -y wget python-pip python2.7-dev libsdl1.2debian libfdt1 libpixman-1-0 nodejs npm libfreetype6 libx11-6 rlwrap - - name: virtualenv - run: pip install virtualenv - - name: get sdk - run: if [ ! -d sdk ]; then mkdir sdk && wget -q -O - https://developer.rebble.io/s3.amazonaws.com/assets.getpebble.com/pebble-tool/pebble-sdk-4.5-linux64.tar.bz2 | tar xj --strip-components=1 -C sdk; fi - - name: requirements - run: if [ ! -d sdk/.env ]; then cd sdk && virtualenv .env && bash -c "source .env/bin/activate && pip install -r requirements.txt && deactivate" && cd ..; fi - - name: sdk-core - run: if [ ! -f sdk/sdk-core-4.3.tar.bz2 ]; then wget https://github.com/aveao/PebbleArchive/raw/master/SDKCores/sdk-core-4.3.tar.bz2 -O sdk/sdk-core-4.3.tar.bz2; fi + python-version: '3.x' + - name: install uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: install pebble + run: uv tool install pebble-tool - name: install sdk - run: if [ ! -d ~/.pebble-sdk ]; then mkdir -p ~/.pebble-sdk && touch ~/.pebble-sdk/NO_TRACKING && sdk/bin/pebble sdk install sdk/sdk-core-4.3.tar.bz2; fi - - name: make - run: make travis_build + run: pebble sdk install 4.5 + - name: make + run: pebble build - name: Upload PBW - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: App - path: ${{ github.workspace }}/build/*.pbw + path: ${{ github.workspace }}/build/MinimalAnalog.pbw + diff --git a/Makefile b/Makefile index 4b9810c..8f36b16 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,6 @@ config: log: pebble logs --emulator $(PEBBLE_EMULATOR) -travis_build: init_overlays - yes | sdk/bin/pebble build - install: pebble install --emulator $(PEBBLE_EMULATOR) From 21436f12fd6050034293b09070ac1e89c07b0e6f Mon Sep 17 00:00:00 2001 From: Daktak Date: Mon, 13 Oct 2025 09:14:13 +1100 Subject: [PATCH 4/4] fix action upload --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7ce3c6..b4fb1c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,5 +39,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: App - path: ${{ github.workspace }}/build/MinimalAnalog.pbw + path: ${{ github.workspace }}/build/*.pbw