esp32c3.yml 2.2 KB

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