From 3fb4ee226acabeb36a689bdd4583b9839efbdc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=8B=D1=80=D1=86=D0=B5=D0=B2=20=D0=92=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=20=D0=98=D0=B3=D0=BE=D1=80=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sun, 21 Jan 2024 12:08:28 +0300 Subject: [PATCH] Update ci.yml to allow Postgres testing --- .github/workflows/ci.yml | 17 ++++++++++++++++- .github/workflows/postgres/init.sql | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/postgres/init.sql diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d6d70fa..43713cc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/postgres/init.sql b/.github/workflows/postgres/init.sql new file mode 100644 index 00000000..f7da96c8 --- /dev/null +++ b/.github/workflows/postgres/init.sql @@ -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; \ No newline at end of file