Skip to content

test: add psql tests #31

test: add psql tests

test: add psql tests #31

Workflow file for this run

name: ci
on:
push:
branches: ["main"]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/**"
pull_request:
branches: ["main"]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/**"
env:
CARGO_TERM_COLOR: always
jobs:
ci:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install postgres
run: sudo apt-get install postgresql postgresql-client
- name: Update path
run: find /usr/lib/postgresql/ -type d -name "bin" >> $GITHUB_PATH
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
coverage:
name: code-coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup toolchain install stable --component llvm-tools
- name: Install postgres
run: sudo apt-get install postgresql postgresql-client
- name: Update path
run: find /usr/lib/postgresql/ -type d -name "bin" >> $GITHUB_PATH
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --tests --lcov --output-path lcov.info
- name: Upload coverage to coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info