Skip to content

TLS for postgres connections in tests #400

TLS for postgres connections in tests

TLS for postgres connections in tests #400

Workflow file for this run

# SPDX-FileCopyrightText: 2023 Phoenix R&D GmbH <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Run docker-based tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
SQLX_OFFLINE: true
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: phnx_db
jobs:
docker-build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name postgres
ports:
- 5432:5432
steps:
# Increase number of postgres connections
- name: Alter max connections
run: |
docker exec -i postgres bash << EOF
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf
EOF
docker restart --time 0 postgres
sleep 5
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: "stable"
cache: true
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Set up CI
run: cd prototype && make setup-ci
- name: Integrate bridge
run: cd prototype && make frb-integrate
- name: Run docker-based tests
run: cargo test --verbose -- --ignored