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

Add DB to CI #4

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
on: [ push, pull_request ]
on:
push:
branches: [ 'main', 'develop' ]
pull_request:
branches: [ 'main', 'develop' ]

name: CI

jobs:
check:
name: Check
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand All @@ -26,6 +31,23 @@ jobs:
test:
name: Test Suite
runs-on: ubuntu-latest

services:
postgres:
image: postgres:12
env:
POSTGRES_DB: rust_todo_api_dev
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
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

steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand All @@ -41,6 +63,9 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/rust_todo_api_dev


lints:
name: Lints
Expand Down
Loading