Implement load balancing strategies and update configuration; add rou… #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: [ "**" ] | |
| pull_request: | |
| branches: [ "**" ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Cache Dependencies | |
| uses: actions/cache@v3 | |
| id: gomod-cache | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('go.mod') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Install Dependencies | |
| run: go mod tidy | |
| - name: Lint | |
| run: | | |
| go install golang.org/x/lint/golint@latest | |
| golint ./... | |
| - name: Format Check | |
| run: | | |
| unformatted=$(go fmt ./...) | |
| if [ -n "$unformatted" ]; then | |
| echo "The following files are not formatted:" | |
| echo "$unformatted" | |
| exit 1 | |
| else | |
| echo "Code is formatted." | |
| fi | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Test | |
| run: go test -v ./... |