build.yml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. name: Build
  2. on: [pull_request, push, repository_dispatch]
  3. jobs:
  4. # Unit testing with Ceedling
  5. unit-test:
  6. runs-on: ubuntu-latest
  7. steps:
  8. - name: Setup Ruby
  9. uses: actions/setup-ruby@v1
  10. - name: Checkout TinyUSB
  11. uses: actions/checkout@v2
  12. - name: Unit Tests
  13. run: |
  14. # Install Ceedling
  15. gem install ceedling
  16. cd test
  17. ceedling test:all
  18. # Build most of the ports
  19. build:
  20. runs-on: ubuntu-latest
  21. strategy:
  22. fail-fast: false
  23. matrix:
  24. example: ['board_test', 'cdc_dual_ports', 'cdc_msc', 'cdc_msc_freertos', 'dfu_rt',
  25. 'hid_composite', 'hid_composite_freertos', 'hid_generic_inout', 'midi_test', 'msc_dual_lun', 'net_lwip_webserver',
  26. 'usbtmc', 'webusb_serial']
  27. steps:
  28. - name: Setup Python
  29. uses: actions/setup-python@v1
  30. - name: Setup Node.js
  31. uses: actions/setup-node@v1
  32. - name: Cache MSP430 Toolchain
  33. id: cache-msp430
  34. uses: actions/cache@v1
  35. with:
  36. path: /tmp/dl/
  37. # Increment serial number at end when updating downloads
  38. key: msp430-${{ runner.os }}-0
  39. - name: Install Toolchains
  40. run: |
  41. # ARM & RISC-V GCC from xpack
  42. npm install --global xpm
  43. xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
  44. xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest
  45. echo "::add-path::`echo $HOME/opt/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin`"
  46. echo "::add-path::`echo $HOME/opt/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin`"
  47. # TI MSP430 GCC
  48. mkdir -p /tmp/dl/
  49. [ -f "/tmp/dl/msp430-gcc.tar.bz2" ] || wget --progress=dot:mega http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/8_3_0_0/exports/msp430-gcc-8.3.0.16_linux64.tar.bz2 -O /tmp/dl/msp430-gcc.tar.bz2
  50. tar -C $HOME -xaf /tmp/dl/msp430-gcc.tar.bz2
  51. echo "::add-path::`echo $HOME/msp430-gcc-*_linux64/bin`"
  52. - name: Checkout TinyUSB
  53. uses: actions/checkout@v2
  54. with:
  55. # Cannot do submodule checkout here since LWIP's git server cannot checkout unadventised commits (it must use tags)
  56. submodules: 'false'
  57. - name: Checkout Submodules
  58. run: |
  59. git submodule sync --recursive
  60. # Special case LWIP since GNU's Savannah can't do shallow checkout of non-tagged commits
  61. git submodule update --init --recursive lib/lwip
  62. git submodule update --init --recursive --depth 1
  63. - name: Build
  64. run: |
  65. python3 tools/build_all.py ${{ matrix.example }}
  66. # Build ESP32S
  67. build-esp32s:
  68. runs-on: ubuntu-latest
  69. steps:
  70. - name: Setup Python
  71. uses: actions/setup-python@v1
  72. - name: Pull ESP-IDF docker
  73. run: docker pull espressif/idf:latest
  74. - name: Checkout TinyUSB
  75. uses: actions/checkout@v2
  76. with:
  77. submodules: 'false'
  78. - name: Build
  79. run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s.py