reshape/.github/workflows/test.yaml
fabianlindfors eeb20f6ce0 Use prebuilt cargo Github action
This makes no difference right now but will make it easier to add
cross-compilation later as the cargo Github action has built-in support
for `cross`: https://github.com/actions-rs/cargo.
2021-12-29 00:35:03 +01:00

45 lines
1.0 KiB
YAML

name: Tests
on:
push:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
integration-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_DB: migra_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Select Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Use cache for Rust dependencies
uses: Swatinem/rust-cache@v1
- name: Run integration tests
uses: actions-rs/cargo@v1
with:
command: test
args: -- --test-threads=1
env:
POSTGRES_CONNECTION_STRING: "postgres://postgres:postgres@127.0.0.1/migra_test"