github.com/chainreactors/fingers@v1.2.1/.github/workflows/ci.yml (about) 1 name: CI 2 3 on: 4 push: 5 branches: [master] 6 pull_request: 7 branches: [master] 8 9 permissions: 10 contents: read 11 12 env: 13 COMPAT_PKGS: >- 14 github.com/chainreactors/fingers 15 github.com/chainreactors/fingers/alias 16 github.com/chainreactors/fingers/common 17 github.com/chainreactors/fingers/ehole 18 github.com/chainreactors/fingers/favicon 19 github.com/chainreactors/fingers/fingerprinthub 20 github.com/chainreactors/fingers/fingers 21 github.com/chainreactors/fingers/goby 22 github.com/chainreactors/fingers/nmap 23 github.com/chainreactors/fingers/resources 24 github.com/chainreactors/fingers/wappalyzer 25 github.com/chainreactors/fingers/xray 26 27 jobs: 28 test: 29 name: test 30 runs-on: ubuntu-latest 31 32 steps: 33 - name: Checkout 34 uses: actions/checkout@v4 35 36 - name: Setup Go 37 uses: actions/setup-go@v5 38 with: 39 go-version: '1.22.x' 40 cache: true 41 42 - name: Vet 43 run: go vet ./... 44 45 - name: Build 46 run: go build ./... 47 48 - name: Test 49 run: go test -short -timeout 300s -race -count=1 ./... 50 51 go117-build: 52 name: Go 1.17 compatibility build 53 runs-on: ubuntu-latest 54 55 steps: 56 - name: Checkout 57 uses: actions/checkout@v4 58 59 - name: Setup Go for vendoring 60 uses: actions/setup-go@v5 61 with: 62 go-version: '1.22.x' 63 cache: true 64 65 - name: Prepare vendor tree 66 run: go mod vendor 67 68 - name: Setup Go 1.17 69 uses: actions/setup-go@v5 70 with: 71 go-version: '1.17.x' 72 73 - name: Build with Go 1.17 74 env: 75 GO111MODULE: off 76 CGO_ENABLED: '0' 77 run: | 78 export GOPATH="${RUNNER_TEMP}/gopath" 79 src="${GOPATH}/src/github.com/chainreactors/fingers" 80 mkdir -p "$(dirname "${src}")" 81 cp -a . "${src}" 82 cd "${src}" 83 go build -tags="noembed goregexp" ${COMPAT_PKGS} 84 85 go111-build: 86 name: Go 1.11 compatibility build 87 runs-on: ubuntu-latest 88 89 steps: 90 - name: Checkout 91 uses: actions/checkout@v4 92 93 - name: Setup Go for vendoring 94 uses: actions/setup-go@v5 95 with: 96 go-version: '1.22.x' 97 cache: true 98 99 - name: Prepare Go 1.11 vendor tree 100 shell: bash 101 run: | 102 set -euo pipefail 103 104 export GO111MODULE=on 105 export GOPATH="${RUNNER_TEMP}/gopath" 106 src="${GOPATH}/src/github.com/chainreactors/fingers" 107 mkdir -p "$(dirname "${src}")" 108 rsync -a --delete \ 109 --exclude '.git' \ 110 --exclude '.claude' \ 111 --exclude 'dist' \ 112 --exclude 'vendor' \ 113 --exclude 'cmd' \ 114 . "${src}/" 115 116 cd "${src}" 117 go mod vendor 118 119 # Go 1.11 does not understand //go:build (Go 1.17+). 120 # For files that have //go:build but no // +build, convert the 121 # constraint to the old format so Go 1.11 can parse it. 122 go run scripts/add_plusbuild.go vendor/ 123 124 - name: Setup Go 1.11 125 uses: actions/setup-go@v5 126 with: 127 go-version: '1.11.13' 128 129 - name: Build with Go 1.11 130 env: 131 GO111MODULE: off 132 CGO_ENABLED: '0' 133 run: | 134 export GOPATH="${RUNNER_TEMP}/gopath" 135 cd "${GOPATH}/src/github.com/chainreactors/fingers" 136 # Root pkg and nmap excluded (nmap uses strings.ReplaceAll, 137 # Go 1.12+; root imports nmap). cmd excluded. 138 go build -tags="noembed goregexp" \ 139 github.com/chainreactors/fingers/alias \ 140 github.com/chainreactors/fingers/common \ 141 github.com/chainreactors/fingers/ehole \ 142 github.com/chainreactors/fingers/favicon \ 143 github.com/chainreactors/fingers/fingerprinthub \ 144 github.com/chainreactors/fingers/fingers \ 145 github.com/chainreactors/fingers/goby \ 146 github.com/chainreactors/fingers/resources \ 147 github.com/chainreactors/fingers/wappalyzer \ 148 github.com/chainreactors/fingers/xray