esp32c3-idf5.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: esp32c3-idf5
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/esp32c3-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. 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 python3 python3-pip libncurses5-dev -y
  22. mkdir -p ~/esp
  23. cd ~/esp
  24. git clone --recursive https://github.com/espressif/esp-idf.git
  25. cd ~/esp/esp-idf
  26. git submodule update --init --recursive
  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/openLuat/luatos-soc-idf5'
  33. - name: build
  34. run: |
  35. mkdir luatosfw
  36. cd ../luatos-soc-idf5/luatos
  37. sed -i 's/E:\/\/code\/codeup\/LuatOS\//\/home\/runner\/work\/LuatOS\/LuatOS/g' CMakeLists.txt
  38. . ~/esp/esp-idf/export.sh
  39. idf.py set-target esp32c3
  40. idf.py build
  41. mv *.soc ../../LuatOS/luatosfw
  42. - name: Upload artifact
  43. uses: actions/upload-artifact@v1
  44. with:
  45. name: esp32c3
  46. path: luatosfw
  47. - name: report if failure
  48. if: always()
  49. env:
  50. STATUS: ${{ job.status }}
  51. MQTTADDR: ${{ secrets.MQTTADDR }}
  52. MQTTPORT: ${{ secrets.MQTTPORT }}
  53. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  54. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  55. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  56. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  57. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  58. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  59. run: |
  60. sudo pip3 install paho_mqtt gitpython requests
  61. cd tools
  62. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "LuatOS-ESP32-IDF5" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi