-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9a172a
commit a9cb02a
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
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
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 |