main.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. name: build
  2. on: [push, pull_request]
  3. jobs:
  4. build_win:
  5. runs-on: windows-latest
  6. steps:
  7. - uses: actions/checkout@v3
  8. - uses: ilammy/msvc-dev-cmd@v1
  9. - name: Compile
  10. shell: bash
  11. run: |
  12. python3 build.py windows
  13. python3 build.py windows -lib
  14. mkdir -p output/windows/x86_64
  15. cp pocketpy.exe output/windows/x86_64
  16. cp pocketpy.dll output/windows/x86_64
  17. - uses: actions/upload-artifact@v3
  18. with:
  19. path: output
  20. - name: Unit Test
  21. run: python3 scripts/run_tests.py
  22. - name: Benchmark
  23. run: python3 scripts/run_tests.py benchmark
  24. build_linux:
  25. runs-on: ubuntu-latest
  26. steps:
  27. - uses: actions/checkout@v3
  28. - name: Setup Clang
  29. uses: egor-tensin/setup-clang@v1
  30. with:
  31. version: 15
  32. platform: x64
  33. - name: Install libc++
  34. run: sudo apt install -y libc++-15-dev libc++1-15 libc++abi-15-dev libc++abi1-15
  35. - name: Compile
  36. run: |
  37. python3 build.py linux
  38. python3 build.py linux -lib
  39. mkdir -p output/linux/x86_64
  40. cp pocketpy output/linux/x86_64
  41. cp pocketpy.so output/linux/x86_64
  42. - uses: actions/upload-artifact@v3
  43. with:
  44. path: output
  45. - name: Unit Test
  46. run: python3 scripts/run_tests.py
  47. - name: Benchmark
  48. run: python3 scripts/run_tests.py benchmark
  49. - name: GCC Build Test
  50. run: g++ -o pocketpy --std=c++17 src/main.cpp
  51. - name: C Binding Test
  52. run: bash run_c_binding_test.sh
  53. build_macos:
  54. runs-on: macos-latest
  55. steps:
  56. - uses: actions/checkout@v3
  57. - run: |
  58. python3 amalgamate.py
  59. cd plugins/macos/pocketpy
  60. mkdir -p output/macos
  61. xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  62. cp -r build/Release/pocketpy.bundle output/macos
  63. - uses: actions/upload-artifact@v3
  64. with:
  65. path: plugins/macos/pocketpy/output
  66. build_android:
  67. runs-on: ubuntu-latest
  68. steps:
  69. - uses: actions/checkout@v3
  70. - uses: subosito/flutter-action@v2
  71. with:
  72. flutter-version: '3.3.0'
  73. channel: 'stable'
  74. cache: true
  75. - run: flutter --version
  76. - name: Compile
  77. run: |
  78. python3 amalgamate.py
  79. cd plugins/flutter/example
  80. flutter build apk --split-debug-info=.debug-info --split-per-abi
  81. cd build/app/outputs/flutter-apk
  82. mkdir -p output/android/arm64-v8a
  83. mkdir -p output/android/armeabi-v7a
  84. mkdir -p output/android/x86_64
  85. unzip -q app-arm64-v8a-release.apk -d tmp
  86. mv tmp/lib/arm64-v8a/libpocketpy.so output/android/arm64-v8a/libpocketpy.so
  87. rm -rf tmp
  88. unzip -q app-armeabi-v7a-release.apk -d tmp
  89. mv tmp/lib/armeabi-v7a/libpocketpy.so output/android/armeabi-v7a/libpocketpy.so
  90. rm -rf tmp
  91. unzip -q app-x86_64-release.apk -d tmp
  92. mv tmp/lib/x86_64/libpocketpy.so output/android/x86_64/libpocketpy.so
  93. rm -rf tmp
  94. - uses: actions/upload-artifact@v3
  95. with:
  96. path: plugins/flutter/example/build/app/outputs/flutter-apk/output
  97. build_web:
  98. runs-on: ubuntu-latest
  99. steps:
  100. - uses: actions/checkout@v3
  101. - name: Setup emsdk
  102. uses: mymindstorm/setup-emsdk@v12
  103. with:
  104. version: 3.1.25
  105. actions-cache-folder: 'emsdk-cache'
  106. - name: Verify emsdk
  107. run: emcc -v
  108. - name: Compile
  109. run: |
  110. mkdir -p output/web/lib
  111. python3 build.py web
  112. cp web/lib/* output/web/lib
  113. - uses: actions/upload-artifact@v3
  114. with:
  115. path: output