2019-12-27 21:39:44 +07:00
|
|
|
name: Build
|
2019-12-27 16:34:25 +07:00
|
|
|
|
2021-01-26 22:34:29 +07:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
repository_dispatch:
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- created
|
2019-12-27 16:34:25 +07:00
|
|
|
|
|
|
|
jobs:
|
2020-04-07 11:15:59 +07:00
|
|
|
# Unit testing with Ceedling
|
2019-12-27 20:58:37 +07:00
|
|
|
unit-test:
|
2020-04-18 15:38:33 +07:00
|
|
|
runs-on: ubuntu-latest
|
2019-12-27 20:58:37 +07:00
|
|
|
steps:
|
|
|
|
- name: Setup Ruby
|
2020-04-06 20:35:52 +07:00
|
|
|
uses: actions/setup-ruby@v1
|
2021-01-29 11:30:15 +07:00
|
|
|
with:
|
|
|
|
ruby-version: '2.7'
|
2020-10-01 13:37:54 -05:00
|
|
|
|
2019-12-27 20:58:37 +07:00
|
|
|
- name: Checkout TinyUSB
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Unit Tests
|
|
|
|
run: |
|
|
|
|
# Install Ceedling
|
|
|
|
gem install ceedling
|
|
|
|
cd test
|
|
|
|
ceedling test:all
|
|
|
|
|
2021-01-23 18:32:56 +07:00
|
|
|
# build all example for each family
|
|
|
|
build-family:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
family:
|
2021-01-26 22:34:29 +07:00
|
|
|
# Alphabetical order
|
2021-01-23 18:32:56 +07:00
|
|
|
- 'imxrt'
|
2021-03-01 12:35:17 +07:00
|
|
|
- 'lpc55'
|
2021-01-23 18:32:56 +07:00
|
|
|
- 'nrf'
|
2021-01-24 01:28:56 +07:00
|
|
|
- 'rp2040'
|
2021-02-04 14:17:51 +07:00
|
|
|
- 'samd11'
|
2021-01-23 18:32:56 +07:00
|
|
|
- 'samd21'
|
|
|
|
- 'samd51'
|
|
|
|
- 'stm32f4'
|
|
|
|
- 'stm32f7'
|
|
|
|
steps:
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
|
2021-01-25 16:42:00 +07:00
|
|
|
- name: Install Toolchains
|
2021-01-25 16:11:18 +07:00
|
|
|
run: |
|
2021-01-25 16:42:00 +07:00
|
|
|
# ARM GCC from xpack
|
|
|
|
npm install --global xpm
|
|
|
|
xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
|
2021-02-03 13:29:59 +07:00
|
|
|
echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH
|
2021-01-23 18:32:56 +07:00
|
|
|
|
|
|
|
- name: Checkout TinyUSB
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-03-01 20:25:55 +07:00
|
|
|
submodules: 'false'
|
2021-01-23 18:32:56 +07:00
|
|
|
|
|
|
|
- name: Checkout Sub-Submodules
|
|
|
|
run: |
|
2021-03-01 20:25:55 +07:00
|
|
|
# Clone all submodules in lib
|
|
|
|
git submodule update --init --recursive lib
|
2021-01-23 18:46:06 +07:00
|
|
|
# some submodule has it own submodules that need to be fetched as well
|
2021-03-01 20:25:55 +07:00
|
|
|
#git submodule update --init --recursive hw/mcu/microchip
|
2021-01-23 18:32:56 +07:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: python3 tools/build_family.py ${{ matrix.family }}
|
|
|
|
|
2021-01-26 22:04:20 +07:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-01-26 22:34:29 +07:00
|
|
|
name: ${{ matrix.family }}-tinyusb-examples
|
2021-01-26 22:04:20 +07:00
|
|
|
path: _bin/
|
2021-01-26 21:23:51 +07:00
|
|
|
|
2021-02-05 21:24:46 +07:00
|
|
|
- name: Create Release Asset
|
|
|
|
if: ${{ github.event_name == 'release' }}
|
|
|
|
run: |
|
|
|
|
cd _bin/
|
2021-02-05 21:53:33 +07:00
|
|
|
zip -r ../${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip *
|
2021-02-05 21:24:46 +07:00
|
|
|
|
|
|
|
- name: Upload Release Asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
if: ${{ github.event_name == 'release' }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
|
|
asset_path: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
|
|
|
|
asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
|
|
|
|
asset_content_type: application/zip
|
|
|
|
|
2021-01-25 15:38:29 +07:00
|
|
|
|