esp32-s2_dfu/.github/workflows/build.yml

100 lines
2.5 KiB
YAML
Raw Normal View History

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