debug.yml 5.3 KB

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