fix(zebrad): release the per-peer mempool slot on verification timeout #2695
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: Unit Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, labeled] | |
| push: | |
| branches: [main] | |
| merge_group: | |
| # Cancel obsolete test runs after new commits. Unrelated label events use a | |
| # separate group so they cannot cancel the required unit test run. | |
| concurrency: | |
| group: >- | |
| ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ | |
| github.event.action == 'labeled' && | |
| github.event.label.name != 'A-release' && | |
| 'ignored-label' || | |
| 'required' | |
| }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| RUST_LIB_BACKTRACE: 1 | |
| RUST_LOG: info | |
| COLORBT_SHOW_HIDDEN: 1 | |
| jobs: | |
| changes: | |
| if: github.event.action != 'labeled' || github.event.label.name == 'A-release' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| unit_tests: ${{ steps.filter.outputs.unit_tests || 'true' }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| persist-credentials: false | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| if: github.event_name == 'pull_request' | |
| with: | |
| filters: .github/path-filters.yml | |
| run-unit-tests: | |
| name: stable 1.97.0 | |
| needs: changes | |
| if: needs.changes.outputs.unit_tests == 'true' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| statuses: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 | |
| with: | |
| toolchain: 1.97.0 | |
| cache-key: unit-tests-1.97.0-default-release-binaries | |
| cache-on-failure: true | |
| # Restore on every ref, but only write from main. This is the longest | |
| # job in CI, so it is the one that suffers most when PR-scoped caches | |
| # evict main's copy. See "Rust build caching" in README.md. | |
| cache-save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 #v2.79.3 | |
| with: | |
| tool: cargo-nextest | |
| - uses: ./.github/actions/setup-zebra-build | |
| - name: Run unit tests | |
| run: cargo nextest run --profile ci --locked --release --features default-release-binaries --run-ignored=all | |
| check-no-git-dependencies: | |
| name: Check no git dependencies | |
| needs: changes | |
| if: needs.changes.outputs.unit_tests == 'true' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'A-release') | |
| permissions: | |
| contents: read | |
| id-token: write | |
| statuses: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 | |
| with: | |
| toolchain: 1.97.0 | |
| cache-on-failure: true | |
| - uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 #v2.79.3 | |
| with: | |
| tool: cargo-nextest | |
| - uses: ./.github/actions/setup-zebra-build | |
| - name: Check no git dependencies | |
| run: cargo nextest run --profile check-no-git-dependencies --locked --run-ignored=only | |
| unit-tests: | |
| # Keep skipped unrelated-label runs from replacing the required check. | |
| name: >- | |
| ${{ | |
| github.event.action == 'labeled' && | |
| github.event.label.name != 'A-release' && | |
| 'Label does not require unit tests' || | |
| 'unit-tests' | |
| }} | |
| runs-on: ubuntu-latest | |
| if: >- | |
| always() && | |
| (github.event.action != 'labeled' || | |
| github.event.label.name == 'A-release') | |
| needs: | |
| - changes | |
| - run-unit-tests | |
| - check-no-git-dependencies | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe #v1.2.2 | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| allowed-skips: run-unit-tests, check-no-git-dependencies |