on: [push, pull_request]
name: Stable Test
jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.40.0
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Check all
uses: actions-rs/cargo@v1
with:
command: check
args: --all --features "full"
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.40.0
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
volumes:
- /var/run:/var/run/postgresql
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Install psql
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Load test data
run: psql -h localhost -U postgres -d postgres < tests/load-data.sql
env:
PGPASSWORD: "postgres"
- name: Run all tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --features "full" --no-fail-fast -- --nocapture
env:
TCP_URL: "postgresql:///postgres?host=localhost&user=postgres&password=postgres"
UDS_URL: "postgresql:///postgres?host=/var/run&user=postgres&password=postgres"