Skip to content

*: Switch to anyhow::Result (fixes #50) #367

*: Switch to anyhow::Result (fixes #50)

*: Switch to anyhow::Result (fixes #50) #367

Workflow file for this run

name: CI
on: [ push, pull_request ]
jobs:
test:
env:
POSTGRESQL: 16
runs-on: ubuntu-24.04 # XXX: switch to latest
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt,llvm-tools-preview,clippy
- name: Install dependencies
run: |
curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main $POSTGRESQL" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get install postgresql-$POSTGRESQL postgresql-server-dev-$POSTGRESQL
- name: Prepare postgresql
run: |
sudo sh -c "echo 'host all all samehost trust' > /etc/postgresql/$POSTGRESQL/main/pg_hba.conf"
sudo pg_ctlcluster $POSTGRESQL main restart
- name: Save rust version for proper cache setup
run: rustc -V > .rustc.version
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-
- uses: actions/cache@v4
with:
path: |
target/
key: ${{ runner.os }}-target-${{ hashFiles('.rustc.version') }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-target-${{ hashFiles('.rustc.version') }}-
- name: Format check
run: cargo fmt --check
- name: Clippy check
run: cargo clippy
- name: Test
run: cargo test
env:
DATABASE_URL: postgres://postgres@localhost:5432/