Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 38 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@ on:
permissions:
contents: read

env:
COMPAT_PKGS: >-
github.com/chainreactors/fingers
github.com/chainreactors/fingers/alias
github.com/chainreactors/fingers/common
github.com/chainreactors/fingers/ehole
github.com/chainreactors/fingers/favicon
github.com/chainreactors/fingers/fingerprinthub
github.com/chainreactors/fingers/fingers
github.com/chainreactors/fingers/goby
github.com/chainreactors/fingers/nmap
github.com/chainreactors/fingers/resources
github.com/chainreactors/fingers/wappalyzer
github.com/chainreactors/fingers/xray

jobs:
test:
name: test
Expand All @@ -36,52 +21,70 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: 'stable'
cache: true

# go.mod declares go 1.17: vet's stdversion check flags any newer
# standard library API, and tidy must not raise the go line.
- name: Tidy
run: |
go mod tidy -go=1.17 -compat=1.17
git diff --exit-code go.mod go.sum

- name: Vet
run: go vet -tags "re2_cgo re2_static" ./...
run: go vet ./...

- name: Build
run: go build -tags "re2_cgo re2_static" ./...
run: go build ./...

- name: Test
run: go test -tags "re2_cgo re2_static" -short -timeout 300s -race -count=1 ./...
run: go test -short -timeout 300s -race -count=1 ./...

go117-build:
name: Go 1.17 compatibility build
re2:
name: re2 module
runs-on: ubuntu-latest
defaults:
run:
working-directory: re2

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go for vendoring
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: '1.24.x'
cache: true

- name: Prepare vendor tree
run: go mod vendor
- name: Vet
run: go vet -tags "re2_cgo re2_static" ./...

- name: Test
run: go test -tags "re2_cgo re2_static" -count=1 ./...

go117:
name: Go 1.17 module build and test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go 1.17
uses: actions/setup-go@v5
with:
go-version: '1.17.x'

- name: Build with Go 1.17
- name: Build
env:
GO111MODULE: off
CGO_ENABLED: '0'
run: |
export GOPATH="${RUNNER_TEMP}/gopath"
src="${GOPATH}/src/github.com/chainreactors/fingers"
mkdir -p "$(dirname "${src}")"
cp -a . "${src}"
cd "${src}"
go build -tags="noembed goregexp" ${COMPAT_PKGS}
GOTOOLCHAIN: local
run: go build ./...

- name: Test
env:
GOTOOLCHAIN: local
run: go test -short -timeout 300s -count=1 ./...

go111-build:
name: Go 1.11 compatibility build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ resources/nmap-service-probes.txt
/CLAUDE.md
/MIGRATION.md
vendor/
/.judge-data/
/scripts/__pycache__/
Loading
Loading