diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b4fb1c6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,43 @@ +# 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: [ dev,master ] + pull_request: + branches: [ dev,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-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@v5 + - uses: actions/setup-python@v5 + with: + 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: pebble sdk install 4.5 + - name: make + run: pebble build + - name: Upload PBW + uses: actions/upload-artifact@v4 + with: + name: App + path: ${{ github.workspace }}/build/*.pbw + diff --git a/Makefile b/Makefile index c348c32..8f36b16 100644 --- a/Makefile +++ b/Makefile @@ -1,40 +1,56 @@ -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) + +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