diff --git a/.github/workflows/deployment-checks.yml b/.github/workflows/deployment-checks.yml index c52968dea..9ba80825f 100644 --- a/.github/workflows/deployment-checks.yml +++ b/.github/workflows/deployment-checks.yml @@ -12,17 +12,32 @@ jobs: DB_PASSWORD: password SECRET_BASE_KEY: test_key RAILS_ENV: production + services: + postgres: + image: postgres + env: + POSTGRES_DB: ${{ env.DB_NAME }} + POSTGRES_USER: ${{ env.DB_USER }} + POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 steps: - - uses: harmon758/postgresql-action@v1 - with: - postgresql db: ${DB_NAME} - postgresql user: ${DB_USER} - postgresql password: ${DB_PASSWORD} - name: Set up database - - uses: actions/checkout@v4 name: Set up Ruby - - uses: ruby/setup-ruby@v1 with: bundler-cache: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d1907383..cee5cf256 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,23 +12,35 @@ jobs: DB_PASSWORD: password SECRET_BASE_KEY: test_key RAILS_ENV: test - REDIS_TEST_URL: redis://localhost:6456/0 + REDIS_TEST_URL: redis://localhost:6379/0 + services: + postgres: + image: postgres + env: + POSTGRES_DB: ${{ env.DB_NAME }} + POSTGRES_USER: ${{ env.DB_USER }} + POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 steps: - name: Install system dependencies run: | sudo apt-get update sudo apt-get install imagemagick - - name: Set up database - uses: harmon758/postgresql-action@v1 - with: - postgresql db: ${DB_NAME} - postgresql user: ${DB_USER} - postgresql password: ${DB_PASSWORD} - - name: Set up Redis - uses: supercharge/redis-github-action@1.5.0 - with: - redis-version: 6 - redis-port: 6456 - name: Check out code uses: actions/checkout@v4 - name: Install Ruby & gems