Skip to content

chore(ci): add integration test to CI #2

chore(ci): add integration test to CI

chore(ci): add integration test to CI #2

Workflow file for this run

on: [push, pull_request]
name: Build
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Check Code Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- name: Run Rustfmt
run: cargo fmt -- --check
build:
name: Build and Test Project
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@master
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: clippy
- name: Cache Rust dependcies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-
${{ runner.os }}-cargo-
- name: Build
run: cargo build
- name: Run Clippy
run: cargo clippy
- name: Run Integration Tests
run: cargo test
env:
TEST_DATABASE_URL: "postgres://postgres:postgres@postgres/postgres"
RUST_LOG: "debug,backend=trace,test_main=trace,tokio_postgres=info"
JWT_SECRET: "secret"