update: fix tests #6
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.24 | |
| - name: Install dependencies | |
| run: | | |
| go install honnef.co/go/tools/cmd/staticcheck@latest | |
| go install golang.org/x/lint/golint | |
| go mod download | |
| echo "$HOME/go/bin" >> $GITHUB_PATH | |
| - name: Run staticcheck | |
| run: | | |
| echo "::group::Running staticcheck" | |
| staticcheck ./... || true | |
| echo "::endgroup::" | |
| echo "::group::Running lint" | |
| golint ./... || true | |
| echo "::endgroup::" | |
| - name: Build | |
| run: GOOS=linux go build -o dist/${BINARY_NAME} ipvsctl.go | |
| - name: Run tests | |
| run: | | |
| SKIP_IPVSKERNELREQ=1 go test -v -coverprofile=coverage.out ./... | |
| go tool cover -html=coverage.out -o coverage.html | |
| - name: Upload HTML coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage.html |