Update ci.yml to allow Postgres testing

This commit is contained in:
Сырцев Вадим Игоревич 2024-01-21 12:08:28 +03:00
parent f0b7681cb3
commit 3fb4ee226a
2 changed files with 20 additions and 1 deletions

View file

@ -8,7 +8,7 @@ on:
name: Continuous integration
env:
RUSTFLAGS: "--cfg CI_REDIS -Dwarnings"
RUSTFLAGS: "--cfg CI_REDIS CI_POSTGRES -Dwarnings"
RUSTDOCFLAGS: -Dwarnings
RUST_BACKTRACE: short
@ -74,6 +74,21 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
# Setup Postgres for testing PostgresStorage
postgres:
image: postgres
volumes:
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
env:
POSTGRES_USER: teloxide
POSTGRES_PASSWORD: rewrite_it_in_rust
ports:
- 5432:5432
strategy:
matrix:
rust:

4
.github/workflows/postgres/init.sql vendored Normal file
View file

@ -0,0 +1,4 @@
CREATE ROLE teloxide WITH LOGIN SUPERUSER PASSWORD 'rewrite_it_in_rust'
CREATE DATABASE test_postgres_json;
CREATE DATABASE test_postgres_bincode;
CREATE_DATABASE test_postgres_cbor;