chore: add sh scripts #7
This file contains 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 | |
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 --release | |
- name: Delay for all docker service startup # TODO: its good for now... but have to fix later | |
run: sleep 15 | |
- name: Run tests | |
run: cargo test --verbose -- --nocapture |