Merge rust-bitcoin/corepc#540: ci: migrate GitHub Actions to cargo rbmt #1675
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
| --- # rust-bitcoin CI: If you edit this file please update README.md | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - master | |
| - 'test-ci/**' | |
| pull_request: | |
| name: Continuous integration | |
| jobs: | |
| Test: # 6 jobs: 3 toolchains × 2 lock files. | |
| name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dep: [minimal, recent] | |
| toolchain: [stable, nightly, msrv] | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | |
| - name: "Run ${{ matrix.toolchain }} tests" | |
| run: | | |
| cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }} \ | |
| -p bitreq \ | |
| -p corepc-client \ | |
| -p jsonrpc-fuzz \ | |
| -p jsonrpc \ | |
| -p corepc-types | |
| Lint: | |
| name: Lint - nightly toolchain | |
| runs-on: ubuntu-latest | |
| env: | |
| BITCOIND_SKIP_DOWNLOAD: "1" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dep: [recent] | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | |
| - name: "Run lints" | |
| run: | | |
| cargo rbmt --lock-file ${{ matrix.dep }} lint \ | |
| -p bitreq \ | |
| -p corepc-client \ | |
| -p jsonrpc-fuzz \ | |
| -p jsonrpc \ | |
| -p corepc-types | |
| ./contrib/lint-integration-tests.sh | |
| ./contrib/lint-verify.sh | |
| Docs: | |
| name: Docs - stable toolchain | |
| runs-on: ubuntu-latest | |
| env: | |
| BITCOIND_SKIP_DOWNLOAD: "1" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dep: [recent] | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | |
| - name: "Run doc tests" | |
| run: cargo rbmt --lock-file ${{ matrix.dep }} docs | |
| Docsrs: | |
| name: Docs - nightly toolchain | |
| runs-on: ubuntu-latest | |
| env: | |
| BITCOIND_SKIP_DOWNLOAD: "1" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dep: [recent] | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | |
| - name: "Run docsrs tests" | |
| run: cargo rbmt --lock-file ${{ matrix.dep }} docsrs | |
| Format: # 1 job, run cargo fmt directly. | |
| name: Format - nightly toolchain | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | |
| - name: "Check formatting" | |
| run: | | |
| cargo rbmt fmt --check | |
| ./contrib/fmt-integration-tests.sh | |
| ./contrib/fmt-verify.sh | |
| Verify: # 1 job, run `verify` directly. | |
| name: Verify - stable toolchain | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - name: "Select toolchain" | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: "Run the verify program" | |
| # Verify all versions (known to the verify program) | |
| run: cd verify && cargo run all | |
| Integration: # 1 job for each bitcoind version we support. | |
| name: Integration tests - stable toolchain | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| [ | |
| "30_2", | |
| # Don't integration test v30.0 and v30.1 as the binaries have been | |
| # removed due to a wallet migration bug. | |
| "29_0", | |
| "28_2", | |
| "28_1", | |
| "28_0", | |
| "27_2", | |
| "27_1", | |
| "27_0", | |
| "26_2", | |
| "25_2", | |
| "24_2", | |
| "23_2", | |
| "22_1", | |
| "0_21_2", | |
| "0_20_2", | |
| "0_19_1", | |
| "0_18_1", | |
| "0_17_2", | |
| ] | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | |
| - name: "Cache downloaded bitcoind" | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/.cache/corepc/bitcoind | |
| key: bitcoind-${{ runner.os }}-${{ runner.arch }}-${{ matrix.version }} | |
| - name: "Run integration tests" | |
| env: | |
| BITCOIND_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/corepc/bitcoind | |
| run: cd integration_test && cargo test --features=${{ matrix.version }},download |