update benchmark to readme #1538
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ['tip', '1.25', '1.24', '1.23', '1.22', '1.21', '1.20', '1.19', '1.18'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| if: matrix.go-version != 'tip' | |
| uses: actions/setup-go@master | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Setup Go tip if needed | |
| if: matrix.go-version == 'tip' | |
| run: | | |
| set -ex | |
| curl --head https://github.com/phuslu/go/releases/download/v0.0.0/gotip.linux-amd64.tar.xz | |
| sleep 1 | |
| curl -LOJ https://github.com/phuslu/go/releases/download/v0.0.0/gotip.linux-amd64.tar.xz | |
| rm -rf /usr/local/go | |
| sudo tar xJf gotip.linux-amd64.tar.xz -C /usr/local | |
| sudo ln -sf /usr/local/go/bin/go /usr/bin/go | |
| go version | |
| - name: Build | |
| run: go build -v -race | |
| - name: Test | |
| run: go test -v | |
| - name: Bench | |
| run: go test -v -run=none -bench=. | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: v1.60 |