wasm.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: wasm
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/wasm.yml'
  6. # - 'lua/**'
  7. # - 'luat/**'
  8. # - 'components/**'
  9. - 'bsp/sysp/**'
  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-get install git gcc-multilib libc6 libgcc1 libstdc++5 libstdc++6 libsdl-dev p7zip-full -y
  20. sudo apt-get install libncurses5-dev -y
  21. - name: make
  22. run: |
  23. cd ..
  24. git clone https://github.com/emscripten-core/emsdk.git
  25. cd emsdk
  26. ./emsdk install latest
  27. ./emsdk activate latest
  28. source ./emsdk_env.sh
  29. cd ../LuatOS/bsp/sysp/build
  30. emcmake cmake ..
  31. emmake make -j16
  32. mkdir ../../../luatosfw
  33. mv *.html ../../../luatosfw
  34. mv luatos.* ../../../luatosfw
  35. - name: Upload artifact
  36. uses: actions/upload-artifact@v1
  37. with:
  38. name: wasm
  39. path: luatosfw
  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. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  48. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  49. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  50. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  51. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  52. run: |
  53. sudo pip3 install paho_mqtt gitpython requests
  54. cd tools
  55. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "wasm" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi