Enforce Post only on /check #23
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: [main] | ||
| pull_request: true | ||
| jobs: | ||
| test: | ||
| name: Lint, unit tests, integration tests | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| redis: | ||
| image: redis:7-alpine | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 5s | ||
| --health-timeout 3s | ||
| --health-retries 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
| cache: true | ||
| - name: Lint | ||
| uses: golangci/golangci-lint-action@v4 | ||
| with: | ||
| version: latest | ||
| - name: Unit tests (with race detector) | ||
| run: go test -race ./internal/... -v | ||
| - name: Build binary | ||
| run: go build ./cmd/server/... | ||
| - name: Start service for integration tests | ||
| run: | | ||
| REDIS_ADDR=localhost:6379 ./server & | ||
| sleep 2 # wait for service to be ready | ||
| env: | ||
| HTTP_ADDR: ":8080" | ||
| GRPC_ADDR: ":50051" | ||
| - name: Integration tests | ||
| run: go test -tags=integration -v ./tests/integration/... | ||
| env: | ||
| REDIS_ADDR: localhost:6379 | ||
| SERVICE_ADDR: http://localhost:8080 | ||