fix: deadlock when replacing logging stream sink #825
Workflow file for this run
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
# SPDX-FileCopyrightText: 2023 Phoenix R&D GmbH <[email protected]> | |
# | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
name: Build and test Rust code | |
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: | |
rust-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cargo-machete | |
uses: taiki-e/install-action@cargo-machete | |
- run: cargo machete | |
rust-lock: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- run: cargo metadata --locked | |
rust-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 | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
- name: Set up CI | |
run: cd prototype && make setup-ci | |
- name: Integrate bridge | |
run: cd prototype && make frb-integrate | |
- name: Rustfmt | |
run: cargo fmt -- --check | |
- name: Clippy | |
run: cargo clippy --locked --all-targets | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose |