Skip to content

Github Actions CI #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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
- name: Upload PBW
uses: actions/upload-artifact@v2
with:
name: App
path: ${{ github.workspace }}/build/*.pbw
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.*
!.github
!.gitignore
!.travis.yml
build
Expand Down
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

# 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: init_overlays
pebble 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:
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:
pebble wipe

.PHONY: all build config log install clean size logs screenshot deploy timeline-on timeline-off wipe phone-logs