main.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. name: build
  2. on:
  3. push:
  4. paths-ignore:
  5. - 'docs/**'
  6. - 'web/**'
  7. - '**.md'
  8. pull_request:
  9. paths-ignore:
  10. - 'docs/**'
  11. - 'web/**'
  12. - '**.md'
  13. jobs:
  14. build_win:
  15. runs-on: windows-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. - uses: ilammy/msvc-dev-cmd@v1
  19. - name: Compile
  20. shell: bash
  21. run: |
  22. mkdir -p output/windows/x86_64
  23. python3 cmake_build.py
  24. cp main.exe output/windows/x86_64
  25. cp pocketpy.dll output/windows/x86_64
  26. - uses: actions/upload-artifact@v3
  27. with:
  28. path: output
  29. - name: Unit Test
  30. run: python3 scripts/run_tests.py
  31. - name: Benchmark
  32. run: python3 scripts/run_tests.py benchmark
  33. build_linux:
  34. runs-on: ubuntu-20.04
  35. steps:
  36. - uses: actions/checkout@v3
  37. - name: Setup Clang
  38. uses: egor-tensin/setup-clang@v1
  39. with:
  40. version: 15
  41. platform: x64
  42. - name: Install libc++
  43. run: sudo apt-get install -y libc++-15-dev libc++1-15 libc++abi-15-dev libc++abi1-15 libclang-rt-15-dev
  44. - name: Unit Test with Coverage
  45. run: bash run_tests.sh
  46. - name: Upload coverage reports to Codecov
  47. uses: codecov/codecov-action@v3
  48. with:
  49. token: ${{ secrets.CODECOV_TOKEN }}
  50. directory: .coverage
  51. if: github.ref == 'refs/heads/main'
  52. - name: Compile
  53. run: |
  54. export CXX=clang++
  55. export CC=clang
  56. mkdir -p output/linux/x86_64
  57. python3 cmake_build.py
  58. cp main output/linux/x86_64
  59. cp libpocketpy.so output/linux/x86_64
  60. - uses: actions/upload-artifact@v3
  61. with:
  62. path: output
  63. - name: Benchmark
  64. run: python3 scripts/run_tests.py benchmark
  65. - name: C Binding Test
  66. run: bash run_c_binding_test.sh
  67. build_linux_x86:
  68. runs-on: ubuntu-latest
  69. steps:
  70. - uses: actions/checkout@v3
  71. - name: Setup Alpine Linux v3.15 for aarch64
  72. uses: jirutka/setup-alpine@v1
  73. with:
  74. arch: x86
  75. packages: gcc g++ make cmake libc-dev linux-headers python3
  76. branch: v3.15
  77. - name: Build and Test
  78. run: |
  79. uname -m
  80. python3 cmake_build.py
  81. python3 scripts/run_tests.py
  82. python3 scripts/run_tests.py benchmark
  83. shell: alpine.sh {0}
  84. build_macos:
  85. runs-on: macos-latest
  86. steps:
  87. - uses: actions/checkout@v3
  88. - name: Compile and Test
  89. run: |
  90. python3 cmake_build.py
  91. python3 scripts/run_tests.py
  92. - name: Benchmark
  93. run: python3 scripts/run_tests.py benchmark
  94. - run: |
  95. python3 amalgamate.py
  96. cd plugins/macos/pocketpy
  97. mkdir -p output/macos
  98. xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  99. cp -r build/Release/pocketpy.bundle output/macos
  100. - uses: actions/upload-artifact@v3
  101. with:
  102. path: plugins/macos/pocketpy/output
  103. build_android:
  104. runs-on: ubuntu-latest
  105. steps:
  106. - uses: actions/checkout@v3
  107. - uses: subosito/flutter-action@v2
  108. with:
  109. flutter-version: '3.3.0'
  110. channel: 'stable'
  111. cache: true
  112. - run: flutter --version
  113. - name: Compile
  114. run: |
  115. python3 amalgamate.py
  116. cd plugins/flutter/example
  117. flutter build apk --split-debug-info=.debug-info --split-per-abi
  118. cd build/app/outputs/flutter-apk
  119. mkdir -p output/android/arm64-v8a
  120. mkdir -p output/android/armeabi-v7a
  121. mkdir -p output/android/x86_64
  122. unzip -q app-arm64-v8a-release.apk -d tmp
  123. mv tmp/lib/arm64-v8a/libpocketpy.so output/android/arm64-v8a/libpocketpy.so
  124. rm -rf tmp
  125. unzip -q app-armeabi-v7a-release.apk -d tmp
  126. mv tmp/lib/armeabi-v7a/libpocketpy.so output/android/armeabi-v7a/libpocketpy.so
  127. rm -rf tmp
  128. unzip -q app-x86_64-release.apk -d tmp
  129. mv tmp/lib/x86_64/libpocketpy.so output/android/x86_64/libpocketpy.so
  130. rm -rf tmp
  131. - uses: actions/upload-artifact@v3
  132. with:
  133. path: plugins/flutter/example/build/app/outputs/flutter-apk/output