github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/.github/workflows/debug.yml (about)

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