Unverified Commit fd4f7bbf authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Add TinyUSB examples to CI (#163)

parent 77eae66c
......@@ -9,6 +9,7 @@ on:
jobs:
# Me no spell so good
code-spell:
name: Check spelling
runs-on: ubuntu-latest
......@@ -25,13 +26,13 @@ jobs:
skip: ./pico-extras,./ArduinoCore-API,./libraries/SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst
ignore_words_list: ser,DOUT
# Build all examples on linux (core and Arduino IDE)
build-linux:
name: Build ${{ matrix.chunk }}
runs-on: ubuntu-latest
strategy:
matrix:
chunk: [0, 1, 2, 3, 4, 5, 6, 7]
chunk: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v2
with:
......@@ -50,7 +51,7 @@ jobs:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_TAG: ${{ github.ref }}
BUILD_PARITY: custom
mod: 8
mod: 4
rem: ${{ matrix.chunk }}
run: |
cd pico-sdk
......@@ -60,6 +61,35 @@ jobs:
cd ..
bash ./tests/build.sh
# Build TinyUSB examples, requires custom build command line
build-tinyusb:
name: Build TinyUSB Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Cache Linux toolchain
id: cache-linux
uses: actions/cache@v2
with:
path: ./tools/dist
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
- name: Build Sketches
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_TAG: ${{ github.ref }}
BUILD_PARITY: custom
run: |
cd pico-sdk
git submodule update --init
cd ../pico-extras
git submodule update --init
cd ..
bash ./tests/build-tinyusb.sh
# Single build under Windows to ensure the Win toolchain is good.
build-windows:
......
Subproject commit 1b8b9c9b071065235341d0e503f2d6d05de19524
Subproject commit d26aa1bbd2c5563b3a96ab4a3acccecbd91bb690
#!/usr/bin/env bash
cache_dir=$(mktemp -d)
source "$TRAVIS_BUILD_DIR"/tests/common.sh
install_arduino nodebug
# Replace the skip function to only build TinyUSB tests
function skip_ino()
{
local ino=$1
local skiplist=""
echo $ino | grep -q Adafruit_TinyUSB_Arduino
if [ $? -eq 0 ]; then
# Add items to the following list with "\n" netween them to skip running. No spaces, tabs, etc. allowed
read -d '' skiplist << EOL || true
/mouse_external_flash/
/hid_keyboard/
/msc_external_flash/
/msc_external_flash_sdcard/
/msc_sdfat/
/msc_sd/
/midi_pizza_box_dj/
/hid_composite_joy_featherwing/
EOL
echo $ino | grep -q -F "$skiplist"
echo $(( 1 - $? ))
else
echo 1
fi
}
build_sketches_with_arduino 1 0 "--usbstack tinyusb"
rm -rf "$cache_dir"
......@@ -16,7 +16,6 @@ elif [ "$BUILD_PARITY" = "odd" ]; then
fi
install_arduino nodebug
build_sketches_with_arduino "$mod" "$rem"
build_sketches_with_arduino "$mod" "$rem" ""
rm -rf "$cache_dir"
......@@ -65,6 +65,7 @@ function build_sketches()
local build_dir=build.tmp
local build_mod=$4
local build_rem=$5
mkdir -p $build_dir
local build_cmd="python3 tools/build.py -b generic -v -w all -v -k --build_cache $cache_dir -p ./$build_dir $build_arg "
if [ "$WINDOWS" = "1" ]; then
......@@ -149,8 +150,13 @@ function install_libraries()
pushd $HOME/Arduino/libraries
# install ArduinoJson library
{ test -r ArduinoJson-v6.11.0.zip || curl --output ArduinoJson-v6.11.0.zip -L https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip -q ArduinoJson-v6.11.0.zip
{ test -r ArduinoJson-v6.11.0.zip || curl -sS --output ArduinoJson-v6.11.0.zip -L https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip -qo ArduinoJson-v6.11.0.zip
{ test -r Adafruit_SPIFlash-3.4.1.zip || curl -sS --output Adafruit_SPIFlash-3.4.1.zip -L https://github.com/adafruit/Adafruit_SPIFlash/archive/refs/tags/3.4.1.zip; } && unzip -qo Adafruit_SPIFlash-3.4.1.zip
{ test -r Adafruit_Seesaw-1.4.3.zip || curl -sS --output Adafruit_Seesaw-1.4.3.zip -L https://github.com/adafruit/Adafruit_Seesaw/archive/refs/tags/1.4.3.zip; } && unzip -qo Adafruit_Seesaw-1.4.3.zip
{ test -r Adafruit_BusIO-1.7.3.zip || curl -sS --output Adafruit_BusIO-1.7.3.zip -L https://github.com/adafruit/Adafruit_BusIO/archive/refs/tags/1.7.3.zip; } && unzip -qo Adafruit_BusIO-1.7.3.zip
{ test -r Adafruit_CircuitPlayground-1.11.3.zip || curl -sS --output Adafruit_CircuitPlayground-1.11.3.zip -L https://github.com/adafruit/Adafruit_CircuitPlayground/archive/refs/tags/1.11.3.zip; } && unzip -qo Adafruit_CircuitPlayground-1.11.3.zip
{ test -r Adafruit_NeoPixel-1.8.1.zip || curl -sS --output Adafruit_NeoPixel-1.8.1.zip -L https://github.com/adafruit/Adafruit_NeoPixel/archive/refs/tags/1.8.1.zip; } && unzip -qo Adafruit_NeoPixel-1.8.1.zip
{ test -r Arduino_MIDI_Library-5.0.2.zip || curl -sS --output Arduino_MIDI_Library-5.0.2.zip -L https://github.com/FortySevenEffects/arduino_midi_library/archive/refs/tags/5.0.2.zip; } && unzip -qo Arduino_MIDI_Library-5.0.2.zip
popd
}
......@@ -236,11 +242,12 @@ function build_sketches_with_arduino()
{
local build_mod=$1
local build_rem=$2
local build_extra=$3
# Compile sketches
echo -e "travis_fold:start:sketch_test"
build_sketches $HOME/arduino_ide $HOME/arduino_ide/examples "-l $HOME/Arduino/libraries" $build_mod $build_rem
build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries" $build_mod $build_rem
build_sketches $HOME/arduino_ide $HOME/arduino_ide/examples "-l $HOME/Arduino/libraries ${build_extra}" $build_mod $build_rem
build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries ${build_extra}" $build_mod $build_rem
echo -e "travis_fold:end:sketch_test"
# Generate size report
......
......@@ -53,7 +53,7 @@ while true; do
cat << EOF
Which build?
1. main
2. main + IPv6
2. tinyusb
4. debug even
5. debug odd
6. platformio
......@@ -67,7 +67,7 @@ EOF
BUILD_TYPE=""
case "$answer" in
1) BUILD_TYPE=build;;
2) BUILD_TYPE=build6;;
2) BUILD_TYPE=build_tinyusb;;
4) BUILD_TYPE=debug_even;;
5) BUILD_TYPE=debug_odd;;
6) BUILD_TYPE=platformio;;
......@@ -99,8 +99,8 @@ elif [ "$BUILD_TYPE" = "debug_even" ]; then
elif [ "$BUILD_TYPE" = "debug_odd" ]; then
BUILD_PARITY=odd tests/debug.sh
elif [ "$BUILD_TYPE" = "build6" ]; then
tests/build6.sh
elif [ "$BUILD_TYPE" = "build_tinyusb" ]; then
tests/build-tinyusb.sh
elif [ "$BUILD_TYPE" = "build6_even" ]; then
BUILD_PARITY=even tests/build6.sh
elif [ "$BUILD_TYPE" = "build6_odd" ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment