pico.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: pico
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/pico.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. - 'bsp/raspberrypi-pico/**'
  10. workflow_dispatch:
  11. jobs:
  12. build:
  13. runs-on: ubuntu-20.04
  14. steps:
  15. - uses: actions/checkout@v1
  16. - name: prepare software
  17. run: |
  18. cd ..
  19. sudo apt update
  20. sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib gettext -y
  21. - name: clone pico-sdk
  22. run: |
  23. git clone https://github.com/raspberrypi/pico-sdk.git ~/work/action/pico-sdk
  24. cd ~/work/action/pico-sdk
  25. git submodule update --init
  26. - name: make
  27. run: |
  28. cd bsp/raspberrypi-pico
  29. mkdir build
  30. cd build
  31. cmake .. -DPICO_SDK_PATH=~/work/action/pico-sdk
  32. make
  33. mkdir target
  34. mv pico-luatos* target
  35. - name: Upload artifact
  36. uses: actions/upload-artifact@v1
  37. with:
  38. name: pico-luatos
  39. path: bsp/raspberrypi-pico/build/target
  40. - name: report if failure
  41. if: always()
  42. env:
  43. STATUS: ${{ job.status }}
  44. MQTTADDR: ${{ secrets.MQTTADDR }}
  45. MQTTPORT: ${{ secrets.MQTTPORT }}
  46. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  47. run: |
  48. sudo pip3 install paho_mqtt
  49. cd tools
  50. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "pico https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID"; fi