debug.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. name: Debug build
  2. on:
  3. push:
  4. branches:
  5. - main-next
  6. - dev-next
  7. paths-ignore:
  8. - '**.md'
  9. - '.github/**'
  10. - '!.github/workflows/debug.yml'
  11. pull_request:
  12. branches:
  13. - main-next
  14. - dev-next
  15. jobs:
  16. build:
  17. name: Debug build
  18. runs-on: ubuntu-latest
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v3
  22. with:
  23. fetch-depth: 0
  24. - name: Get latest go version
  25. id: version
  26. run: |
  27. 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
  28. - name: Setup Go
  29. uses: actions/setup-go@v3
  30. with:
  31. go-version: ${{ steps.version.outputs.go_version }}
  32. - name: Cache go module
  33. uses: actions/cache@v3
  34. with:
  35. path: |
  36. ~/go/pkg/mod
  37. key: go-${{ hashFiles('**/go.sum') }}
  38. - name: Add cache to Go proxy
  39. run: |
  40. version=`git rev-parse HEAD`
  41. mkdir build
  42. pushd build
  43. go mod init build
  44. go get -v github.com/sagernet/sing-box@$version
  45. popd
  46. continue-on-error: true
  47. - name: Run Test
  48. run: |
  49. go test -v ./...
  50. build_go118:
  51. name: Debug build (Go 1.18)
  52. runs-on: ubuntu-latest
  53. steps:
  54. - name: Checkout
  55. uses: actions/checkout@v3
  56. with:
  57. fetch-depth: 0
  58. - name: Setup Go
  59. uses: actions/setup-go@v3
  60. with:
  61. go-version: 1.18.7
  62. - name: Cache go module
  63. uses: actions/cache@v3
  64. with:
  65. path: |
  66. ~/go/pkg/mod
  67. key: go118-${{ hashFiles('**/go.sum') }}
  68. - name: Run Test
  69. run: |
  70. go test -v ./...
  71. cross:
  72. strategy:
  73. matrix:
  74. include:
  75. # windows
  76. - name: windows-amd64
  77. goos: windows
  78. goarch: amd64
  79. goamd64: v1
  80. - name: windows-amd64-v3
  81. goos: windows
  82. goarch: amd64
  83. goamd64: v3
  84. - name: windows-386
  85. goos: windows
  86. goarch: 386
  87. - name: windows-arm64
  88. goos: windows
  89. goarch: arm64
  90. - name: windows-arm32v7
  91. goos: windows
  92. goarch: arm
  93. goarm: 7
  94. # linux
  95. - name: linux-amd64
  96. goos: linux
  97. goarch: amd64
  98. goamd64: v1
  99. - name: linux-amd64-v3
  100. goos: linux
  101. goarch: amd64
  102. goamd64: v3
  103. - name: linux-386
  104. goos: linux
  105. goarch: 386
  106. - name: linux-arm64
  107. goos: linux
  108. goarch: arm64
  109. - name: linux-armv5
  110. goos: linux
  111. goarch: arm
  112. goarm: 5
  113. - name: linux-armv6
  114. goos: linux
  115. goarch: arm
  116. goarm: 6
  117. - name: linux-armv7
  118. goos: linux
  119. goarch: arm
  120. goarm: 7
  121. - name: linux-mips-softfloat
  122. goos: linux
  123. goarch: mips
  124. gomips: softfloat
  125. - name: linux-mips-hardfloat
  126. goos: linux
  127. goarch: mips
  128. gomips: hardfloat
  129. - name: linux-mipsel-softfloat
  130. goos: linux
  131. goarch: mipsle
  132. gomips: softfloat
  133. - name: linux-mipsel-hardfloat
  134. goos: linux
  135. goarch: mipsle
  136. gomips: hardfloat
  137. - name: linux-mips64
  138. goos: linux
  139. goarch: mips64
  140. - name: linux-mips64el
  141. goos: linux
  142. goarch: mips64le
  143. - name: linux-s390x
  144. goos: linux
  145. goarch: s390x
  146. # darwin
  147. - name: darwin-amd64
  148. goos: darwin
  149. goarch: amd64
  150. goamd64: v1
  151. - name: darwin-amd64-v3
  152. goos: darwin
  153. goarch: amd64
  154. goamd64: v3
  155. - name: darwin-arm64
  156. goos: darwin
  157. goarch: arm64
  158. # freebsd
  159. - name: freebsd-amd64
  160. goos: freebsd
  161. goarch: amd64
  162. goamd64: v1
  163. - name: freebsd-amd64-v3
  164. goos: freebsd
  165. goarch: amd64
  166. goamd64: v3
  167. - name: freebsd-386
  168. goos: freebsd
  169. goarch: 386
  170. - name: freebsd-arm64
  171. goos: freebsd
  172. goarch: arm64
  173. fail-fast: false
  174. runs-on: ubuntu-latest
  175. env:
  176. GOOS: ${{ matrix.goos }}
  177. GOARCH: ${{ matrix.goarch }}
  178. GOAMD64: ${{ matrix.goamd64 }}
  179. GOARM: ${{ matrix.goarm }}
  180. GOMIPS: ${{ matrix.gomips }}
  181. CGO_ENABLED: 0
  182. TAGS: with_clash_api,with_quic
  183. steps:
  184. - name: Checkout
  185. uses: actions/checkout@v3
  186. with:
  187. fetch-depth: 0
  188. - name: Get latest go version
  189. id: version
  190. run: |
  191. 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
  192. - name: Setup Go
  193. uses: actions/setup-go@v3
  194. with:
  195. go-version: ${{ steps.version.outputs.go_version }}
  196. - name: Cache go module
  197. uses: actions/cache@v3
  198. with:
  199. path: |
  200. ~/go/pkg/mod
  201. key: go-${{ hashFiles('**/go.sum') }}
  202. - name: Build
  203. id: build
  204. run: make
  205. - name: Upload artifact
  206. uses: actions/upload-artifact@v3
  207. with:
  208. name: sing-box-${{ matrix.name }}
  209. path: sing-box*