Skip to content

Merge pull request #8 from vagmi/dependabot/cargo/axum-0.6.11 #29

Merge pull request #8 from vagmi/dependabot/cargo/axum-0.6.11

Merge pull request #8 from vagmi/dependabot/cargo/axum-0.6.11 #29

Workflow file for this run

name: Rust
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
postgres:
image: "postgres:14"
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_DATABASE: testdb
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Cargo SQLX
run: cargo install sqlx-cli || true
- name: Create DB
run: sqlx db create
env:
DATABASE_URL: postgres://postgres:password@localhost/postgres?sslmode=disable
- name: Run migration
run: sqlx migrate run
env:
DATABASE_URL: postgres://postgres:password@localhost/postgres?sslmode=disable
- name: Build
run: cargo build --verbose
env:
DATABASE_URL: postgres://postgres:password@localhost/postgres?sslmode=disable
- name: Run tests
run: cargo test --verbose
env:
DATABASE_URL: postgres://postgres:password@localhost/postgres?sslmode=disable