Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ on:
pull_request:

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Node dependencies
run: npm install
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm

- name: Cache Node dependencies
uses: actions/cache@v4
Expand All @@ -24,8 +27,51 @@ jobs:
restore-keys: |
node-${{ runner.os }}-

- name: Install Pebble SDK system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libsdl2-2.0-0 \
libglib2.0-0 \
libpixman-1-0 \
zlib1g \
libsndio7.0 \
qemu-system-data

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.13"
enable-cache: true

- name: Install Pebble CLI
run: uv tool install pebble-tool --python 3.13

- name: Add Pebble CLI to PATH
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"

- name: Install Pebble SDK
run: |
pebble sdk install latest
SDK_VERSION="$(ls -1 "${HOME}/.pebble-sdk/SDKs" | grep -E '^[0-9]' | sort -V | tail -1)"
pebble sdk activate "${SDK_VERSION}"
PC_BIOS="${HOME}/.pebble-sdk/SDKs/current/toolchain/lib/pc-bios"
mkdir -p "${PC_BIOS}"
ln -sfn /usr/share/qemu/keymaps "${PC_BIOS}/keymaps"

- name: Install Node dependencies
run: npm install

- name: Type check
run: npm run check-types

- name: Build CLI
run: npm run build

- name: Install test-app dependencies
working-directory: tests/test-app
run: npm install

- name: Run end-to-end tests
working-directory: tests/test-app
run: npm run test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ example/src/pkjs/
node_modules/
.DS_Store
.lock*
bin/
bin/
ts-build/
build/
36 changes: 36 additions & 0 deletions tests/test-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# test-app

A Pebble watchapp/watchface written in C using the Pebble SDK.

## Building & running

```sh
pebble build # build for all targetPlatforms
pebble install --emulator emery # install on the emery emulator
pebble install --phone <ip> # install to a paired phone
```

## Target platforms

`targetPlatforms` in `package.json` controls which watches you build for. The
modern Pebble hardware is **emery** (Pebble Time 2), **gabbro** (Pebble Round
2), and **flint** (Pebble 2 Duo); the original Pebble platforms (aplite,
basalt, chalk, diorite) are included by default for backwards compatibility.

## Project layout

```
src/c/ C source for the watchapp
src/pkjs/ PebbleKit JS (phone-side) source, if any
worker_src/c/ Background worker source, if any
resources/ Images, fonts, and other bundled resources
package.json Project metadata (UUID, platforms, resources, message keys)
wscript Build rules — usually no need to edit
```

By default this project is configured as a watchapp. To make it a watchface,
set `pebble.watchapp.watchface` to `true` in `package.json`.

## Documentation

Full SDK docs, tutorials, and API reference: <https://developer.repebble.com>
52 changes: 52 additions & 0 deletions tests/test-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions tests/test-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "test-app",
"author": "MakeAwesomeHappen",
"version": "1.0.0",
"keywords": ["pebble-app"],
"private": true,
"dependencies": {},
"devDependencies": {
"pkts": "file:../.."
},
"scripts": {
"build": "pkts build",
"test": "node run-tests.mjs"
},
"pebble": {
"displayName": "PKTS Test",
"uuid": "0eb49fc7-d058-474d-b0af-9d15e299704d",
"sdkVersion": "3",
"enableMultiJS": true,
"targetPlatforms": [
"aplite",
"basalt",
"chalk",
"diorite",
"emery",
"flint",
"gabbro"
],
"watchapp": {
"watchface": false
},
"messageKeys": [
"run_test",
"result",
"status"
],
"resources": {
"media": []
}
}
}
Loading
Loading