*: Switch to anyhow::Result (fixes #50) #367
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |