Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in starters .github action DB and redis #201

Closed
kaplanelad opened this issue Dec 20, 2023 · 0 comments
Closed

Adding in starters .github action DB and redis #201

kaplanelad opened this issue Dec 20, 2023 · 0 comments
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@kaplanelad
Copy link
Contributor

kaplanelad commented Dec 20, 2023

In saas and rest-api starters we have .github workflows out of the box that should run fmt,clippy and test.

the idea behind it is to getting automatically working CI.
When running cargo fmt test see here we should also adding service section with postgress and redis

example:

services:
      redis:
        image: redis
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - "6379:6379"
      postgres:
        image: postgres
        env:
          POSTGRES_DB: postgress_test
          POSTGRES_USER: postgress
          POSTGRES_PASSWORD: postgress
        ports:
          - "5432:5432"
        # Set health checks to wait until postgres has started
        options: --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

and also add

env:
  REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
  DATABASE_URL: postgres://postgress:postgress@localhost:5432/postgress_test

section in the test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant