Skip to content

Commit

Permalink
Fixing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
akasaka committed Oct 20, 2024
1 parent 7199dbb commit c7e80a3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ ADMIN_PASS=\"plasma\"
# OpenWeatherMap configuration
WEATHER_LAT=\"43.0642\"
WEATHER_LON=\"141.3469\"
WEATHER_API_KEY=\"your OpenWeatherMap API Key\"
WEATHER_API_KEY=\"your_OpenWeatherMap_API_Key\"

# Wordnik configuration
WORDNIK_API_KEY=\"your Wordnik API key\"
WORDNIK_API_KEY=\"your_Wordnik_API_key\"

# AquesTalk configuration
AQUESTALK_LICENSE_KEY=\"XXX-XXX-XXX\"
20 changes: 0 additions & 20 deletions .github/actions/prepare_pio.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/actions/prepare_pio/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Prepare PIO environment

on: [workflow_call]

runs:
using: "composite"
steps:
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: pisos-pio
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
shell: bash
run: pip install --upgrade platformio
16 changes: 13 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build production version

on:
push:
branches: [main]
branches: [main, develop]

jobs:
build-everything:
Expand All @@ -13,23 +13,33 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Prepare environment
uses: ./.github/actions/prepare_pio
- name: Download AquesTalk
run: |
wget https://www.a-quest.com/archive/package/aquestalk-esp32_0243.zip -O /tmp/aquestalk.zip
unzip /tmp/aquestalk.zip -d /tmp
mv /tmp/aquestalk-esp32/src/esp32/libaquestalk.a ./lib/nonfree-aquestalk/libaquestalk.a
mv /tmp/aquestalk-esp32/src/aquestalk.h ./lib/nonfree-aquestalk/aquestalk.h
- name: Create env file
run: cp ./.env.example ./.env
- name: Build all targets
run: pio run
continue-on-error: true # TODO make this more graceful
- name: Upload firmware images
uses: actions/upload-artifact@v4
with:
name: filesystem
path: ./.pio/build/*/firmware.bin
name: firmwares.zip
if-no-files-found: error
- name: Delete WIP tunes
run: rm ./music/wip_*.pomf
run: rm ./data/music/wip_*.pomf
- name: Create LittleFS image
run: pio run --target buildfs --environment music-pomf
- name: Upload filesystem image
uses: actions/upload-artifact@v4
with:
path: ./.pio/build/music-pomf/littlefs.bin
name: filesystem.zip
if-no-files-found: error
12 changes: 8 additions & 4 deletions helper/aquestalk-detect.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from os.path import isfile
from os.path import isfile, join, abspath
from os import getcwd
Import("env")

if isfile("./lib/nonfree-aquestalk/libaquestalk.a"):
print("Found a copy of AquesTalk")
env.Append(BUILD_FLAGS=["-LD:lib/nonfree-aquestalk", "-laquestalk", "-DLIBAQUESTALK_FOUND"])
DIR_PATH=abspath(join(getcwd(), "lib/nonfree-aquestalk")).replace("\\", "/")
LIB_PATH=join(DIR_PATH, "libaquestalk.a")

if isfile(LIB_PATH):
print("Found a copy of AquesTalk:", LIB_PATH)
env.Append(BUILD_FLAGS=["-L"+DIR_PATH, "-laquestalk", "-DLIBAQUESTALK_FOUND"])
else:
print("No AquesTalk library found")
6 changes: 6 additions & 0 deletions src/service/prefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ inline void init_store_if_needed() {
prefs_set_int(PREFS_KEY_HOURLY_CHIME_MELODY, 2);
prefs_set_bool(PREFS_KEY_VOICE_SPEAK_ON_HEADPAT, true);
prefs_set_bool(PREFS_KEY_WEATHER_OVERLAY, true);
#ifdef WORDNIK_API_KEY
prefs_set_string(PREFS_KEY_WORDNIK_APIKEY, String(WORDNIK_API_KEY));
#endif
#ifdef WEATHER_API_KEY
prefs_set_string(PREFS_KEY_WEATHER_APIKEY, String(WEATHER_API_KEY));
#endif

prefs_set_bool(PREFS_KEY_INITIAL_SETTING_DONE, true);
}
Expand Down

0 comments on commit c7e80a3

Please sign in to comment.