Skip to content

Commit

Permalink
feat: add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-bozin-org committed Apr 21, 2024
1 parent c9a172a commit a9cb02a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Setup .env files
run: |
echo "DATABASE_URL_LOCAL_USERS=${{ secrets.DATABASE_URL_LOCAL_USERS }}" >> .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
- name: Start Services with Docker Compose
run: docker-compose up -d

- name: Install sqlx CLI
run: cargo install sqlx-cli

- name: Build
run: cargo build --verbose

- name: Delay for all docker service startup # TODO: its good for now... but have to fix later
run: sleep 65

- name: Run tests
run: cargo test --verbose -- --nocapture

0 comments on commit a9cb02a

Please sign in to comment.