feat: GraphQL filtering, sorting, search & pagination #109
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: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: hypergoat | |
| POSTGRES_PASSWORD: hypergoat | |
| POSTGRES_DB: hypergoat_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Test with SQLite | |
| run: go test -v -race -coverprofile=coverage-sqlite.out ./... | |
| env: | |
| DATABASE_URL: "sqlite::memory:" | |
| - name: Test with PostgreSQL | |
| run: go test -v -race -coverprofile=coverage-postgres.out ./... | |
| env: | |
| DATABASE_URL: postgres://hypergoat:hypergoat@localhost:5432/hypergoat_test?sslmode=disable | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage-sqlite.out,coverage-postgres.out | |
| fail_ci_if_error: false | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.8.0 | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: false | |
| tags: hypergoat:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |