on d76dbab help sign in
45 lines 1.0 kB history raw
1name: Tests
3on:
4 push:
5 branches: [ main ]
7env:
8 CARGO_TERM_COLOR: always
10jobs:
11 integration-tests:
12 runs-on: ubuntu-latest
14 services:
15 postgres:
16 image: postgres
17 ports:
18 - 5432:5432
19 env:
20 POSTGRES_DB: migra_test
21 POSTGRES_USER: postgres
22 POSTGRES_PASSWORD: postgres
23 # Set health checks to wait until postgres has started
24 options: >-
25 --health-cmd pg_isready
26 --health-interval 10s
27 --health-timeout 5s
28 --health-retries 5
30 steps:
31 - name: Checkout
32 uses: actions/checkout@v2
33 - name: Select Rust toolchain
34 uses: actions-rs/toolchain@v1
35 with:
36 toolchain: stable
37 - name: Use cache for Rust dependencies
38 uses: Swatinem/rust-cache@v1
39 - name: Run integration tests
40 uses: actions-rs/cargo@v1
41 with:
42 command: test
43 args: -- --test-threads=1
44 env:
45 POSTGRES_CONNECTION_STRING: "postgres://postgres:postgres@127.0.0.1/migra_test"