main.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. - name: Setup Clang
  9. uses: egor-tensin/setup-clang@v1
  10. with:
  11. version: 15
  12. platform: x64
  13. - name: Compiling
  14. shell: bash
  15. run: |
  16. python3 build.py windows
  17. python3 build.py windows -lib
  18. mkdir -p output/windows/x86_64
  19. cp pocketpy.exe output/windows/x86_64
  20. cp pocketpy.dll output/windows/x86_64
  21. - uses: actions/upload-artifact@v3
  22. with:
  23. path: output
  24. - name: Unit Test
  25. run: python3 scripts/run_tests.py
  26. - name: Benchmark
  27. run: python3 scripts/run_tests.py benchmark
  28. build_web:
  29. runs-on: ubuntu-latest
  30. steps:
  31. - uses: actions/checkout@v3
  32. - name: Setup emsdk
  33. uses: mymindstorm/setup-emsdk@v12
  34. with:
  35. version: 3.1.25
  36. actions-cache-folder: 'emsdk-cache'
  37. - name: Verify emsdk
  38. run: emcc -v
  39. - name: Compiling
  40. run: |
  41. mkdir -p output/web/lib
  42. python3 build.py web
  43. cp web/lib/* output/web/lib
  44. - uses: crazy-max/ghaction-github-pages@v3
  45. with:
  46. target_branch: gh-pages
  47. build_dir: web
  48. env:
  49. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  50. if: github.event_name == 'push'
  51. - uses: actions/upload-artifact@v3
  52. with:
  53. path: output
  54. build_linux:
  55. runs-on: ubuntu-latest
  56. steps:
  57. - uses: actions/checkout@v3
  58. - name: Setup Clang
  59. uses: egor-tensin/setup-clang@v1
  60. with:
  61. version: 15
  62. platform: x64
  63. - name: Coverage Test
  64. run: |
  65. sudo apt install -y libc++-15-dev libc++1-15 libc++abi-15-dev libc++abi1-15 libclang-rt-15-dev
  66. python3 preprocess.py
  67. bash run_tests.sh
  68. - uses: actions/upload-artifact@v3
  69. with:
  70. name: coverage
  71. path: .coverage
  72. - name: Compiling
  73. run: |
  74. python3 build.py linux
  75. python3 build.py linux -lib
  76. mkdir -p output/linux/x86_64
  77. cp pocketpy output/linux/x86_64
  78. cp pocketpy.so output/linux/x86_64
  79. - uses: actions/upload-artifact@v3
  80. with:
  81. path: output
  82. - name: Unit Test
  83. run: python3 scripts/run_tests.py
  84. - name: Benchmark
  85. run: python3 scripts/run_tests.py benchmark
  86. build_android:
  87. runs-on: ubuntu-latest
  88. steps:
  89. - uses: actions/checkout@v3
  90. - uses: subosito/flutter-action@v2
  91. with:
  92. flutter-version: '3.3.0'
  93. channel: 'stable'
  94. cache: true
  95. - run: flutter --version
  96. - name: Compiling
  97. run: |
  98. python3 amalgamate.py
  99. cd plugins/flutter/example
  100. flutter build apk --split-debug-info=.debug-info --split-per-abi
  101. cd build/app/outputs/flutter-apk
  102. mkdir -p output/android/arm64-v8a
  103. mkdir -p output/android/armeabi-v7a
  104. mkdir -p output/android/x86_64
  105. unzip -q app-arm64-v8a-release.apk -d tmp
  106. mv tmp/lib/arm64-v8a/libpocketpy.so output/android/arm64-v8a/libpocketpy.so
  107. rm -rf tmp
  108. unzip -q app-armeabi-v7a-release.apk -d tmp
  109. mv tmp/lib/armeabi-v7a/libpocketpy.so output/android/armeabi-v7a/libpocketpy.so
  110. rm -rf tmp
  111. unzip -q app-x86_64-release.apk -d tmp
  112. mv tmp/lib/x86_64/libpocketpy.so output/android/x86_64/libpocketpy.so
  113. rm -rf tmp
  114. - uses: actions/upload-artifact@v3
  115. with:
  116. path: plugins/flutter/example/build/app/outputs/flutter-apk/output
  117. build_macos:
  118. runs-on: macos-latest
  119. steps:
  120. - uses: actions/checkout@v3
  121. - run: |
  122. python3 amalgamate.py
  123. cd plugins/macos/pocketpy
  124. mkdir -p output/macos
  125. xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  126. cp -r build/Release/pocketpy.bundle output/macos
  127. - uses: actions/upload-artifact@v3
  128. with:
  129. path: plugins/macos/pocketpy/output