docs: add CI badges, CONTRIBUTING guide and OCI image labels #21
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 - Test Backend | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'rag-api/**' | |
| - '.github/workflows/test-backend.yml' | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - 'rag-api/**' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./rag-api | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: npx prisma generate | |
| - name: Run migrations | |
| env: | |
| DATABASE_URL: postgresql://test:test@localhost:5432/test | |
| run: npx prisma migrate deploy | |
| - name: Run linter | |
| run: pnpm --filter rag-api lint | |
| - name: Run tests | |
| env: | |
| DATABASE_URL: postgresql://test:test@localhost:5432/test | |
| OLLAMA_URL: http://localhost:11434 | |
| run: pnpm --filter rag-api exec jest --coverage --passWithNoTests | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| directory: ./rag-api/coverage | |
| flags: backend | |
| name: backend-coverage |