Skip to content

Commit

Permalink
chore: run tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lajp committed Dec 27, 2023
1 parent 6bc2f3f commit cdc1594
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,40 @@ jobs:
test:
name: Test Suite
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_DB: testaustime
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: test
- name: Install Diesel
run: cargo install diesel_cli --features=postgres
- name: Create Test DB
env:
DATABASE_URL: postgres://postgres:postgres@localhost/testaustime
run: diesel migration run

- name: Run tests
env:
TEST_DATABASE: postgres://postgres:postgres@localhost/testaustime
run: cargo test

fmt:
name: Rustfmt
Expand Down

0 comments on commit cdc1594

Please sign in to comment.