Skip to content

Bump version

Bump version #54

Workflow file for this run

name: test
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Build and test
runs-on: ubuntu-latest
services:
postgres_db:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432/tcp
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Create env file
run: echo 'DATABASE_URL='$DATABASE_URL > ./.env
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:${{ job.services.postgres_db.ports[5432] }}/postgres
- name: Cache crate
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo plugins
uses: actions/cache@v2
with:
path: ~/.cargo/bin/
key: ${{ runner.os }}-cargo-plugins
- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install sqlx-cli
run: which sqlx || cargo install sqlx-cli --no-default-features --features native-tls,postgres
- name: Setup database
run: sqlx migrate run
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
check_fmt:
name: Check fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: fmt
run: cargo fmt -- --check