name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt, clippy
- uses: actions/checkout@v1
- name: Build
run: cargo build
- name: Test
run: cargo test
env:
DATABASE_URL: postgresql://postgres:postgres@localhost/sqlxtest1
- name: Format
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy