2022-07-09 09:02:06 +08:00
|
|
|
name: Debug build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-12-03 17:03:04 +08:00
|
|
|
- main-next
|
2022-08-31 23:45:30 +08:00
|
|
|
- dev-next
|
2022-07-09 09:02:06 +08:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/debug.yml'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
2022-12-03 17:03:04 +08:00
|
|
|
- main-next
|
2022-08-31 23:45:30 +08:00
|
|
|
- dev-next
|
2022-07-09 09:02:06 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Debug build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-07-09 09:02:06 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Get latest go version
|
|
|
|
id: version
|
|
|
|
run: |
|
2023-02-09 22:07:00 +08:00
|
|
|
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
|
2022-07-09 09:02:06 +08:00
|
|
|
- name: Setup Go
|
2023-03-17 15:46:57 +08:00
|
|
|
uses: actions/setup-go@v4
|
2022-07-09 09:02:06 +08:00
|
|
|
with:
|
|
|
|
go-version: ${{ steps.version.outputs.go_version }}
|
2022-07-17 09:11:23 +08:00
|
|
|
- name: Cache go module
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/cache@v3
|
2022-07-17 09:11:23 +08:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
2022-07-17 09:47:04 +08:00
|
|
|
key: go-${{ hashFiles('**/go.sum') }}
|
2022-07-17 09:11:23 +08:00
|
|
|
- name: Add cache to Go proxy
|
2022-07-09 09:02:06 +08:00
|
|
|
run: |
|
|
|
|
version=`git rev-parse HEAD`
|
|
|
|
mkdir build
|
|
|
|
pushd build
|
|
|
|
go mod init build
|
|
|
|
go get -v github.com/sagernet/sing-box@$version
|
|
|
|
popd
|
2022-08-12 22:53:46 +08:00
|
|
|
continue-on-error: true
|
2022-07-09 09:02:06 +08:00
|
|
|
- name: Run Test
|
|
|
|
run: |
|
2022-07-17 09:11:23 +08:00
|
|
|
go test -v ./...
|
2022-10-21 11:54:44 +08:00
|
|
|
build_go118:
|
|
|
|
name: Debug build (Go 1.18)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-10-21 11:54:44 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
2023-03-17 15:46:57 +08:00
|
|
|
uses: actions/setup-go@v4
|
2022-10-21 11:54:44 +08:00
|
|
|
with:
|
2023-02-18 14:26:41 +08:00
|
|
|
go-version: 1.18.10
|
2022-10-21 11:54:44 +08:00
|
|
|
- name: Cache go module
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/cache@v3
|
2022-10-21 11:54:44 +08:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: go118-${{ hashFiles('**/go.sum') }}
|
|
|
|
- name: Run Test
|
2023-02-18 14:26:41 +08:00
|
|
|
run: make
|
2022-07-17 09:47:04 +08:00
|
|
|
cross:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# windows
|
|
|
|
- name: windows-amd64
|
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v1
|
|
|
|
- name: windows-amd64-v3
|
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v3
|
|
|
|
- name: windows-386
|
|
|
|
goos: windows
|
|
|
|
goarch: 386
|
|
|
|
- name: windows-arm64
|
|
|
|
goos: windows
|
|
|
|
goarch: arm64
|
|
|
|
- name: windows-arm32v7
|
|
|
|
goos: windows
|
|
|
|
goarch: arm
|
|
|
|
goarm: 7
|
|
|
|
|
|
|
|
# linux
|
|
|
|
- name: linux-amd64
|
|
|
|
goos: linux
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v1
|
|
|
|
- name: linux-amd64-v3
|
|
|
|
goos: linux
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v3
|
|
|
|
- name: linux-386
|
|
|
|
goos: linux
|
|
|
|
goarch: 386
|
|
|
|
- name: linux-arm64
|
|
|
|
goos: linux
|
|
|
|
goarch: arm64
|
|
|
|
- name: linux-armv5
|
|
|
|
goos: linux
|
|
|
|
goarch: arm
|
|
|
|
goarm: 5
|
|
|
|
- name: linux-armv6
|
|
|
|
goos: linux
|
|
|
|
goarch: arm
|
|
|
|
goarm: 6
|
|
|
|
- name: linux-armv7
|
|
|
|
goos: linux
|
|
|
|
goarch: arm
|
|
|
|
goarm: 7
|
|
|
|
- name: linux-mips-softfloat
|
|
|
|
goos: linux
|
|
|
|
goarch: mips
|
|
|
|
gomips: softfloat
|
|
|
|
- name: linux-mips-hardfloat
|
|
|
|
goos: linux
|
|
|
|
goarch: mips
|
|
|
|
gomips: hardfloat
|
|
|
|
- name: linux-mipsel-softfloat
|
|
|
|
goos: linux
|
|
|
|
goarch: mipsle
|
|
|
|
gomips: softfloat
|
|
|
|
- name: linux-mipsel-hardfloat
|
|
|
|
goos: linux
|
|
|
|
goarch: mipsle
|
|
|
|
gomips: hardfloat
|
|
|
|
- name: linux-mips64
|
|
|
|
goos: linux
|
|
|
|
goarch: mips64
|
|
|
|
- name: linux-mips64el
|
|
|
|
goos: linux
|
|
|
|
goarch: mips64le
|
2022-10-26 19:29:27 +08:00
|
|
|
- name: linux-s390x
|
|
|
|
goos: linux
|
|
|
|
goarch: s390x
|
2022-07-17 09:47:04 +08:00
|
|
|
# darwin
|
|
|
|
- name: darwin-amd64
|
|
|
|
goos: darwin
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v1
|
|
|
|
- name: darwin-amd64-v3
|
|
|
|
goos: darwin
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v3
|
|
|
|
- name: darwin-arm64
|
|
|
|
goos: darwin
|
|
|
|
goarch: arm64
|
|
|
|
# freebsd
|
|
|
|
- name: freebsd-amd64
|
|
|
|
goos: freebsd
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v1
|
|
|
|
- name: freebsd-amd64-v3
|
|
|
|
goos: freebsd
|
|
|
|
goarch: amd64
|
|
|
|
goamd64: v3
|
|
|
|
- name: freebsd-386
|
|
|
|
goos: freebsd
|
|
|
|
goarch: 386
|
|
|
|
- name: freebsd-arm64
|
|
|
|
goos: freebsd
|
|
|
|
goarch: arm64
|
|
|
|
|
|
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GOOS: ${{ matrix.goos }}
|
|
|
|
GOARCH: ${{ matrix.goarch }}
|
|
|
|
GOAMD64: ${{ matrix.goamd64 }}
|
|
|
|
GOARM: ${{ matrix.goarm }}
|
|
|
|
GOMIPS: ${{ matrix.gomips }}
|
|
|
|
CGO_ENABLED: 0
|
2022-08-12 22:53:46 +08:00
|
|
|
TAGS: with_clash_api,with_quic
|
2022-07-17 09:47:04 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-07-17 09:47:04 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Get latest go version
|
|
|
|
id: version
|
2022-07-17 09:11:23 +08:00
|
|
|
run: |
|
2023-02-09 22:07:00 +08:00
|
|
|
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
|
2022-07-17 09:47:04 +08:00
|
|
|
- name: Setup Go
|
2023-03-17 15:46:57 +08:00
|
|
|
uses: actions/setup-go@v4
|
2022-07-17 09:47:04 +08:00
|
|
|
with:
|
|
|
|
go-version: ${{ steps.version.outputs.go_version }}
|
|
|
|
- name: Cache go module
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/cache@v3
|
2022-07-17 09:47:04 +08:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: go-${{ hashFiles('**/go.sum') }}
|
|
|
|
- name: Build
|
|
|
|
id: build
|
2022-08-12 22:53:46 +08:00
|
|
|
run: make
|
2022-07-17 09:47:04 +08:00
|
|
|
- name: Upload artifact
|
2023-02-09 17:42:06 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-07-17 09:47:04 +08:00
|
|
|
with:
|
2022-08-12 22:53:46 +08:00
|
|
|
name: sing-box-${{ matrix.name }}
|
2022-10-26 19:29:27 +08:00
|
|
|
path: sing-box*
|