github.com/sagernet/sing-box@v1.2.7/.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
    66    cross:
    67      strategy:
    68        matrix:
    69          include:
    70            # windows
    71            - name: windows-amd64
    72              goos: windows
    73              goarch: amd64
    74              goamd64: v1
    75            - name: windows-amd64-v3
    76              goos: windows
    77              goarch: amd64
    78              goamd64: v3
    79            - name: windows-386
    80              goos: windows
    81              goarch: 386
    82            - name: windows-arm64
    83              goos: windows
    84              goarch: arm64
    85            - name: windows-arm32v7
    86              goos: windows
    87              goarch: arm
    88              goarm: 7
    89            
    90            # linux
    91            - name: linux-amd64
    92              goos: linux
    93              goarch: amd64
    94              goamd64: v1
    95            - name: linux-amd64-v3
    96              goos: linux
    97              goarch: amd64
    98              goamd64: v3
    99            - name: linux-386
   100              goos: linux
   101              goarch: 386
   102            - name: linux-arm64
   103              goos: linux
   104              goarch: arm64
   105            - name: linux-armv5
   106              goos: linux
   107              goarch: arm
   108              goarm: 5
   109            - name: linux-armv6
   110              goos: linux
   111              goarch: arm
   112              goarm: 6
   113            - name: linux-armv7
   114              goos: linux
   115              goarch: arm
   116              goarm: 7
   117            - name: linux-mips-softfloat
   118              goos: linux
   119              goarch: mips
   120              gomips: softfloat
   121            - name: linux-mips-hardfloat
   122              goos: linux
   123              goarch: mips
   124              gomips: hardfloat
   125            - name: linux-mipsel-softfloat
   126              goos: linux
   127              goarch: mipsle
   128              gomips: softfloat
   129            - name: linux-mipsel-hardfloat
   130              goos: linux
   131              goarch: mipsle
   132              gomips: hardfloat
   133            - name: linux-mips64
   134              goos: linux
   135              goarch: mips64
   136            - name: linux-mips64el
   137              goos: linux
   138              goarch: mips64le
   139            - name: linux-s390x
   140              goos: linux
   141              goarch: s390x
   142            # darwin
   143            - name: darwin-amd64
   144              goos: darwin
   145              goarch: amd64
   146              goamd64: v1
   147            - name: darwin-amd64-v3
   148              goos: darwin
   149              goarch: amd64
   150              goamd64: v3
   151            - name: darwin-arm64
   152              goos: darwin
   153              goarch: arm64
   154            # freebsd
   155            - name: freebsd-amd64
   156              goos: freebsd
   157              goarch: amd64
   158              goamd64: v1
   159            - name: freebsd-amd64-v3
   160              goos: freebsd
   161              goarch: amd64
   162              goamd64: v3
   163            - name: freebsd-386
   164              goos: freebsd
   165              goarch: 386
   166            - name: freebsd-arm64
   167              goos: freebsd
   168              goarch: arm64
   169  
   170        fail-fast: false
   171      runs-on: ubuntu-latest
   172      env:
   173        GOOS: ${{ matrix.goos }}
   174        GOARCH: ${{ matrix.goarch }}
   175        GOAMD64: ${{ matrix.goamd64 }}
   176        GOARM: ${{ matrix.goarm }}
   177        GOMIPS: ${{ matrix.gomips }}
   178        CGO_ENABLED: 0
   179        TAGS: with_clash_api,with_quic
   180      steps:
   181        - name: Checkout
   182          uses: actions/checkout@v3
   183          with:
   184            fetch-depth: 0
   185        - name: Get latest go version
   186          id: version
   187          run: |
   188            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
   189        - name: Setup Go
   190          uses: actions/setup-go@v4
   191          with:
   192            go-version: ${{ steps.version.outputs.go_version }}
   193        - name: Build
   194          id: build
   195          run: make
   196        - name: Upload artifact
   197          uses: actions/upload-artifact@v3
   198          with:
   199            name: sing-box-${{ matrix.name }}
   200            path: sing-box*