win32.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: win32
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/win32.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. - 'bsp/win32/**'
  10. workflow_dispatch:
  11. jobs:
  12. build:
  13. runs-on: windows-2019
  14. defaults:
  15. run:
  16. shell: msys2 {0}
  17. steps:
  18. - uses: actions/checkout@v1
  19. - uses: msys2/setup-msys2@v2
  20. with:
  21. msystem: MINGW64
  22. update: true
  23. install: git mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-toolchain python3 python-pip mingw-w64-clang-x86_64-toolchain mingw-w64-x86_64-xmake p7zip
  24. - name: build
  25. run: |
  26. cd bsp/win32
  27. xmake -y
  28. mkdir luatos_win32/
  29. cp build/out/luatos.exe luatos_win32/
  30. cp build/out/luatos.exe module_test/
  31. cp lib/sys.lua luatos_win32/
  32. cp lib/sys.lua module_test/
  33. echo -e "local sys = require 'sys'\r\n\r\nlog.info('sys', 'from win32')\r\n\r\nsys.taskInit(function ()\r\n while true do\r\n log.info('hi', os.date())\r\n log.info('sys', rtos.meminfo('sys'))\r\n log.info('lua', rtos.meminfo('lua'))\r\n sys.wait(1000)\r\n end\r\nend)\r\n\r\nsys.run()" > luatos_win32/main.lua
  34. cd luatos_win32/
  35. wget https://github.com/openLuat/LuatOS/releases/download/v0.0.1/luat_uart.dll
  36. - name: test
  37. run: |
  38. cd bsp/win32/module_test
  39. sh test.sh
  40. - name: Upload artifact
  41. uses: actions/upload-artifact@v1
  42. with:
  43. name: luatos_win32
  44. path: bsp/win32/luatos_win32
  45. - name: report if failure
  46. if: always()
  47. env:
  48. STATUS: ${{ job.status }}
  49. MQTTADDR: ${{ secrets.MQTTADDR }}
  50. MQTTPORT: ${{ secrets.MQTTPORT }}
  51. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  52. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  53. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  54. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  55. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  56. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  57. run: |
  58. cd tools
  59. pip install paho-mqtt gitpython requests -t ./
  60. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "win32" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi