debug.yml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. name: Debug build
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. paths-ignore:
  7. - '**.md'
  8. - '.github/**'
  9. - '!.github/workflows/debug.yml'
  10. pull_request:
  11. branches:
  12. - dev
  13. jobs:
  14. setup:
  15. name: Setup
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Cancel previous
  19. uses: styfle/[email protected]
  20. with:
  21. access_token: ${{ github.token }}
  22. libcore:
  23. name: Native Build (LibCore)
  24. runs-on: ubuntu-latest
  25. needs:
  26. - setup
  27. steps:
  28. - name: Checkout
  29. uses: actions/checkout@v3
  30. - name: Fetch Status
  31. run: git submodule status library/core > libcore_status
  32. - name: LibCore Cache
  33. id: cache
  34. uses: actions/cache@v3
  35. with:
  36. path: |
  37. app/libs/libcore.aar
  38. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }}
  39. - name: Get latest go version
  40. id: version
  41. if: steps.cache.outputs.cache-hit != 'true'
  42. run: |
  43. echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
  44. - name: Setup Go
  45. uses: actions/setup-go@v3
  46. if: steps.cache.outputs.cache-hit != 'true'
  47. with:
  48. # Bug: https://github.com/golang/go/issues/58426
  49. # go-version: ${{ steps.version.outputs.go_version }}
  50. go-version: 1.19.8
  51. - name: Native Build
  52. if: steps.cache.outputs.cache-hit != 'true'
  53. run: ./run lib core
  54. trojan-go:
  55. name: Native Build (Trojan-Go)
  56. runs-on: ubuntu-latest
  57. needs:
  58. - setup
  59. steps:
  60. - name: Checkout
  61. uses: actions/checkout@v3
  62. - name: Fetch Status
  63. run: git submodule status 'plugin/trojan-go/*' > trojan_go_status
  64. - name: Trojan-Go Cache
  65. id: cache
  66. uses: actions/cache@v3
  67. with:
  68. path: |
  69. plugin/trojan-go/src/main/jniLibs
  70. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/trojan_go/*', 'trojan_go_status') }}
  71. - name: Install Golang
  72. uses: actions/setup-go@v3
  73. if: steps.cache.outputs.cache-hit != 'true'
  74. with:
  75. go-version: 1.17.1
  76. - name: Native Build
  77. if: steps.cache.outputs.cache-hit != 'true'
  78. run: ./run plugin trojan_go
  79. naive:
  80. runs-on: ubuntu-latest
  81. needs:
  82. - setup
  83. name: Native Build (NaïveProxy)
  84. strategy:
  85. fail-fast: false
  86. matrix:
  87. arch: [ armeabi-v7a, arm64-v8a, x86, x86_64 ]
  88. steps:
  89. - name: Checkout
  90. uses: actions/checkout@v3
  91. - name: Fetch Status
  92. run: git submodule status 'plugin/naive/*' > naive_status
  93. - name: Naive Cache
  94. id: cache
  95. uses: actions/cache@v3
  96. with:
  97. path: |
  98. plugin/naive/src/main/jniLibs/${{ matrix.arch }}
  99. key: naive-${{ matrix.arch }}-${{ hashFiles('bin/plugin/naive/*', 'naive_status') }}
  100. - name: Native Build
  101. if: steps.cache.outputs.cache-hit != 'true'
  102. run: |
  103. ./run init action naive
  104. ./run plugin naive init
  105. ./run plugin naive ${{ matrix.arch }}
  106. - name: Calculate SHA256
  107. run: |
  108. openssl sha256 plugin/naive/src/main/jniLibs/${{ matrix.arch }}/libnaive.so > sha256sum.txt
  109. echo "SHA256SUM=$(cut -d' ' -f2 sha256sum.txt)" >>$GITHUB_ENV
  110. - uses: actions/upload-artifact@v3
  111. with:
  112. name: "NAIVE-SHA256-${{ matrix.arch }} ${{ env.SHA256SUM }}"
  113. path: sha256sum.txt
  114. # pingtunnel:
  115. # name: Native Build (PingTunnel)
  116. # runs-on: ubuntu-latest
  117. # needs:
  118. # - setup
  119. # steps:
  120. # - name: Checkout
  121. # uses: actions/checkout@v3
  122. # - name: Fetch Status
  123. # run: git submodule status 'plugin/pingtunnel/*' > pt_status
  124. # - name: PingTunnel Cache
  125. # id: cache
  126. # uses: actions/cache@v3
  127. # with:
  128. # path: |
  129. # plugin/pingtunnel/src/main/jniLibs
  130. # key: ${{ hashFiles('.github/workflows/*', 'bin/lib/pingtunnel/*', 'pt_status') }}
  131. # - name: Install Golang
  132. # uses: actions/setup-go@v3
  133. # if: steps.cache.outputs.cache-hit != 'true'
  134. # with:
  135. # go-version: 1.16
  136. # - name: Native Build
  137. # if: steps.cache.outputs.cache-hit != 'true'
  138. # run: ./run plugin pingtunnel
  139. relaybaton:
  140. name: Native Build (RelayBaton)
  141. runs-on: ubuntu-latest
  142. needs:
  143. - setup
  144. steps:
  145. - name: Checkout
  146. uses: actions/checkout@v3
  147. - name: Fetch Status
  148. run: git submodule status 'plugin/relaybaton/*' > rb_status
  149. - name: RelayBaton Cache
  150. id: cache
  151. uses: actions/cache@v3
  152. with:
  153. path: |
  154. plugin/relaybaton/src/main/jniLibs
  155. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/relaybaton/*', 'rb_status') }}
  156. - name: Install Golang
  157. uses: actions/setup-go@v3
  158. if: steps.cache.outputs.cache-hit != 'true'
  159. with:
  160. go-version: 1.18.10
  161. - name: Native Build
  162. if: steps.cache.outputs.cache-hit != 'true'
  163. run: ./run plugin relaybaton
  164. brook:
  165. name: Native Build (Brook)
  166. runs-on: ubuntu-latest
  167. needs:
  168. - setup
  169. steps:
  170. - name: Checkout
  171. uses: actions/checkout@v3
  172. - name: Fetch Status
  173. run: git submodule status 'plugin/brook/*' > brook_status
  174. - name: Brook Cache
  175. id: cache
  176. uses: actions/cache@v3
  177. with:
  178. path: |
  179. plugin/brook/src/main/jniLibs
  180. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/brook/*', 'brook_status') }}
  181. - name: Install Golang
  182. uses: actions/setup-go@v3
  183. if: steps.cache.outputs.cache-hit != 'true'
  184. with:
  185. go-version: 1.18.0
  186. - name: Native Build
  187. if: steps.cache.outputs.cache-hit != 'true'
  188. run: ./run plugin brook
  189. hysteria:
  190. name: Native Build (Hysteria)
  191. runs-on: ubuntu-latest
  192. needs:
  193. - setup
  194. steps:
  195. - name: Checkout
  196. uses: actions/checkout@v3
  197. - name: Fetch Status
  198. run: git submodule status 'plugin/hysteria/*' > hysteria_status
  199. - name: Hysteria Cache
  200. id: cache
  201. uses: actions/cache@v3
  202. with:
  203. path: |
  204. plugin/hysteria/src/main/jniLibs
  205. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/hysteria/*', 'hysteria_status') }}
  206. - name: Install Golang
  207. uses: actions/setup-go@v3
  208. if: steps.cache.outputs.cache-hit != 'true'
  209. with:
  210. go-version: 1.18.6
  211. - name: Native Build
  212. if: steps.cache.outputs.cache-hit != 'true'
  213. run: ./run plugin hysteria
  214. mieru:
  215. name: Native Build (Mieru)
  216. runs-on: ubuntu-latest
  217. needs:
  218. - setup
  219. steps:
  220. - name: Checkout
  221. uses: actions/checkout@v3
  222. - name: Fetch Status
  223. run: git submodule status 'plugin/mieru/*' > mieru_status
  224. - name: Mieru Cache
  225. id: cache
  226. uses: actions/cache@v3
  227. with:
  228. path: |
  229. plugin/mieru/src/main/jniLibs
  230. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/mieru/*', 'mieru_status') }}
  231. - name: Install Golang
  232. uses: actions/setup-go@v3
  233. if: steps.cache.outputs.cache-hit != 'true'
  234. with:
  235. go-version: 1.20.2
  236. - name: Native Build
  237. if: steps.cache.outputs.cache-hit != 'true'
  238. run: ./run plugin mieru
  239. tuic:
  240. name: Native Build (TUIC)
  241. runs-on: ubuntu-latest
  242. needs:
  243. - setup
  244. steps:
  245. - name: Checkout
  246. uses: actions/checkout@v3
  247. - name: Fetch Status
  248. run: git submodule status 'plugin/tuic/*' > tuic_status
  249. - name: Tuic Cache
  250. id: cache
  251. uses: actions/cache@v3
  252. with:
  253. path: |
  254. plugin/tuic/src/main/jniLibs
  255. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/tuic/*', 'tuic_status') }}
  256. - name: Install toolchain
  257. run: |
  258. rustup toolchain install stable
  259. rustup override set stable
  260. if: steps.cache.outputs.cache-hit != 'true'
  261. - name: Install rust android target
  262. run: ./run init action rust
  263. if: steps.cache.outputs.cache-hit != 'true'
  264. - name: Native Build
  265. if: steps.cache.outputs.cache-hit != 'true'
  266. run: ./run plugin tuic
  267. lint:
  268. name: Android Lint
  269. runs-on: ubuntu-latest
  270. needs:
  271. - libcore
  272. steps:
  273. - name: Checkout
  274. uses: actions/checkout@v3
  275. - name: Fetch Status
  276. run: |
  277. git submodule status library/core > libcore_status
  278. - name: LibCore Cache
  279. uses: actions/cache@v3
  280. with:
  281. path: |
  282. app/libs/libcore.aar
  283. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }}
  284. - name: Gradle cache
  285. uses: actions/cache@v3
  286. with:
  287. path: ~/.gradle
  288. key: gradle-${{ hashFiles('**/*.gradle.kts') }}
  289. - name: Android Lint
  290. env:
  291. BUILD_PLUGIN: none
  292. run: |
  293. echo "sdk.dir=${ANDROID_HOME}" > local.properties
  294. echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
  295. ./run init action library
  296. ./run lint