esp32-idf5.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. name: esp32-idf5
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/esp32-idf5.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. workflow_dispatch:
  10. repository_dispatch:
  11. types:
  12. - webhook-esp32c3-idf5-action
  13. jobs:
  14. build:
  15. runs-on: ubuntu-20.04
  16. strategy:
  17. matrix:
  18. ESP_CHIP: [esp32,esp32c2,esp32c3,esp32s3]
  19. fail-fast: false
  20. steps:
  21. - uses: actions/checkout@v1
  22. - name: prepare software
  23. env:
  24. ESP_CHIP: ${{ matrix.ESP_CHIP }}
  25. run: |
  26. sudo apt-get update
  27. sudo apt-get install git gcc-multilib libc6 libgcc1 libstdc++5 libstdc++6 libsdl-dev p7zip-full python3 python3-pip libncurses5-dev -y
  28. mkdir -p ~/esp
  29. cd ~/esp
  30. git clone --branch=release/v5.0 --recursive https://github.com/espressif/esp-idf.git
  31. cd ~/esp/esp-idf
  32. git submodule update --init --recursive
  33. ./install.sh $ESP_CHIP
  34. - name: clone LuatOS-ESP32
  35. run: |
  36. sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"
  37. cd ..
  38. retry 'git clone --branch=master https://gitee.com/openLuat/luatos-soc-idf5'
  39. - name: build
  40. env:
  41. ESP_CHIP: ${{ matrix.ESP_CHIP }}
  42. run: |
  43. mkdir luatosfw
  44. cd ../luatos-soc-idf5/luatos
  45. sed -i 's/D:\/\/github\/LuatOS\//\/home\/runner\/work\/LuatOS\/LuatOS/g' CMakeLists.txt
  46. . ~/esp/esp-idf/export.sh
  47. idf.py set-target $ESP_CHIP
  48. idf.py build
  49. mv *.soc ../../LuatOS/luatosfw
  50. - name: Upload artifact
  51. uses: actions/upload-artifact@v2
  52. with:
  53. name: ${{ matrix.ESP_CHIP }}-soc
  54. path: luatosfw/
  55. - name: report if failure
  56. if: always()
  57. env:
  58. STATUS: ${{ job.status }}
  59. MQTTADDR: ${{ secrets.MQTTADDR }}
  60. MQTTPORT: ${{ secrets.MQTTPORT }}
  61. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  62. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  63. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  64. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  65. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  66. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  67. ESP_CHIP: ${{ matrix.ESP_CHIP }}
  68. run: |
  69. sudo pip3 install paho_mqtt gitpython requests
  70. cd tools
  71. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "IDF5-$ESP_CHIP" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi