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