Add database persistence benchmarks #1292
Workflow file for this run
This file contains hidden or 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: CI Checks - Benchmarks | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| benchmark: | |
| timeout-minutes: 60 | |
| runs-on: self-hosted | |
| env: | |
| TOOLCHAIN: stable | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_DB: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable | |
| - name: Set Rust override | |
| run: rustup override set stable | |
| - name: Enable caching for bitcoind | |
| id: cache-bitcoind | |
| uses: actions/cache@v4 | |
| with: | |
| path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }} | |
| key: bitcoind-29.0-${{ runner.os }}-${{ runner.arch }} | |
| - name: Enable caching for electrs | |
| id: cache-electrs | |
| uses: actions/cache@v4 | |
| with: | |
| path: bin/electrs-${{ runner.os }}-${{ runner.arch }} | |
| key: electrs-${{ runner.os }}-${{ runner.arch }} | |
| - name: Download bitcoind/electrs | |
| if: "(steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')" | |
| run: | | |
| source ./scripts/download_bitcoind_electrs.sh | |
| mkdir -p bin | |
| mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }} | |
| mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }} | |
| - name: Set bitcoind/electrs environment variables | |
| run: | | |
| echo "BITCOIND_EXE=$( pwd )/bin/bitcoind-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV" | |
| echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV" | |
| - name: Run benchmarks | |
| env: | |
| TEST_POSTGRES_URL: "host=localhost user=postgres password=postgres" | |
| run: | | |
| RUSTFLAGS="--cfg tokio_unstable" cargo test --benches --features "bench postgres" |