Adjust level of replication session and document materialization logs… #2622
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
name: aquadoggo | |
on: push | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_TOOLCHAIN: 1.79.0 | |
cargo_manifest: aquadoggo/Cargo.toml | |
jobs: | |
rust-build-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
cache-target: release | |
- name: Build binary | |
run: | | |
cargo build \ | |
--verbose \ | |
--release \ | |
--manifest-path ${{ env.cargo_manifest }} | |
rust-test-sqlite: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
# Related issue: https://github.com/p2panda/aquadoggo/issues/414 | |
- name: Temporary workaround for rustc bug | |
run: cargo clean | |
- name: Run tests | |
env: | |
# Ensure debug output is also tested | |
RUST_LOG: debug | |
run: | | |
cargo test \ | |
--manifest-path ${{ env.cargo_manifest }} | |
rust-test-postgres: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: aquadoggo-development | |
ports: | |
# Maps TCP port 5432 on service container to the host | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
# Related issue: https://github.com/p2panda/aquadoggo/issues/414 | |
- name: Temporary workaround for rustc bug | |
run: cargo clean | |
- name: Run tests | |
env: | |
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/aquadoggo-development | |
# Make sure the tests run consecutively to avoid accessing the same | |
# database by multiple test threads | |
run: | | |
cargo test \ | |
--manifest-path ${{ env.cargo_manifest }} \ | |
-- --test-threads 1 | |
rust-prop-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
- name: Run tests | |
run: | | |
cargo test proptests::tests \ | |
--manifest-path ${{ env.cargo_manifest }} \ | |
--features=proptests | |
rust-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
- name: Check project and dependencies | |
run: | | |
cargo check \ | |
--manifest-path ${{ env.cargo_manifest }} | |
rust-fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt | |
- name: Check formatting | |
run: | | |
cargo fmt \ | |
--manifest-path ${{ env.cargo_manifest }} \ | |
-- --check | |
rust-clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
components: clippy | |
- name: Check code with clippy | |
run: | | |
cargo clippy \ | |
--manifest-path ${{ env.cargo_manifest }} \ | |
-- -D warnings --no-deps | |
rust-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Protocol Buffers compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: ${{ env.RUST_TOOLCHAIN }} | |
bins: grcov | |
components: llvm-tools-preview | |
- name: Run compiler for source based coverage | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: '-Cinstrument-coverage' | |
LLVM_PROFILE_FILE: 'cargo-test-%p-%m.profraw' | |
run: | | |
cargo test \ | |
--manifest-path ${{ env.cargo_manifest }} | |
- name: Run grcov to generate .lcov file | |
run: | | |
grcov . \ | |
--binary-path ./target/debug/deps/ \ | |
-s . \ | |
-t lcov \ | |
--branch \ | |
--ignore-not-existing \ | |
--ignore '../*' \ | |
--ignore "/*" \ | |
-o coverage.lcov | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.lcov | |
token: ${{ secrets.CODECOV_TOKEN }} |