linux.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: linux
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/linux.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. - 'bsp/linux/**'
  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. sudo apt-get update
  19. sudo apt install git gcc-multilib libc6 libgcc1 libstdc++5 libstdc++6 p7zip-full binutils llvm libsdl2-dev -y
  20. sudo apt install libncurses5-dev cmake -y
  21. sudo add-apt-repository ppa:xmake-io/xmake -y
  22. sudo apt update
  23. sudo apt install xmake
  24. - name: make
  25. run: |
  26. cd bsp/linux
  27. xmake -y
  28. mkdir ../../luatosfw
  29. mv build/out/luatos ../../luatosfw/
  30. - name: Upload artifact
  31. uses: actions/upload-artifact@v1
  32. with:
  33. name: linux
  34. path: luatosfw
  35. - name: report if failure
  36. if: always()
  37. env:
  38. STATUS: ${{ job.status }}
  39. MQTTADDR: ${{ secrets.MQTTADDR }}
  40. MQTTPORT: ${{ secrets.MQTTPORT }}
  41. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  42. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  43. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  44. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  45. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  46. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  47. run: |
  48. sudo pip3 install paho_mqtt gitpython requests
  49. cd tools
  50. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "linux" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi