This repository was archived by the owner on Feb 12, 2026. It is now read-only.
feat: integrate resources management functionality #47
Workflow file for this run
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, development ] | |
| pull_request: | |
| branches: [ main, development ] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| cache: true | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.1 | |
| install-mode: goinstall | |
| args: --timeout=5m | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_USER: podling | |
| POSTGRES_PASSWORD: podling_test | |
| POSTGRES_DB: podling | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| strategy: | |
| matrix: | |
| go-version: [ '1.25' ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Run tests | |
| env: | |
| TEST_DATABASE_URL: postgres://podling:podling_test@localhost:5432/podling?sslmode=disable | |
| run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./... | |
| - name: Check test coverage | |
| run: | | |
| go tool cover -func=coverage.out | tail -1 | |
| # Calculate coverage for internal/ packages only (exclude cmd/) | |
| INTERNAL_COVERAGE=$(go tool cover -func=coverage.out | grep "internal/" | awk '{sum += $3; count++} END {print sum/count}') | |
| echo "Internal packages coverage: ${INTERNAL_COVERAGE}%" | |
| if (( $(echo "INTERNAL_COVERAGE < 60" | bc -l) )); then | |
| echo "❌ Coverage $INTERNAL_COVERAGE% is below minimum 60%" | |
| exit 1 | |
| fi | |
| echo "✅ Coverage $INTERNAL_COVERAGE% meets minimum requirement" | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| if: success() | |
| with: | |
| files: ./coverage.out | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |