-
Notifications
You must be signed in to change notification settings - Fork 61
ci: migrate GitHub Actions to cargo rbmt #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,93 +9,30 @@ on: # yamllint disable-line rule:truthy | |
| name: Continuous integration | ||
|
|
||
| jobs: | ||
| Prepare: | ||
| runs-on: ubuntu-slim | ||
| outputs: | ||
| nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }} | ||
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Read nightly version" | ||
| id: read_toolchain | ||
| run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT | ||
|
|
||
| Stable: # 2 jobs, one per lock file. | ||
| name: Test - stable toolchain | ||
| 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] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW I am not sure how valuable testing on the nighlty toolchain is, but doesn't hurt either. Some recent discussion over here: rust-bitcoin/rust-psbt#87 (comment)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR aims to not modify the previous CI job list, which included nightly. I suppose nightly is here as early warning for upcoming compiler or toolchain changes. |
||
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Checkout maintainer tools" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-bitcoin/rust-bitcoin-maintainer-tools | ||
| ref: c3324024ced9bb1eb854397686919c3ff7d97e1e | ||
| path: maintainer-tools | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: "Set dependencies" | ||
| run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | ||
| - name: "Run test script" | ||
| run: ./maintainer-tools/ci/run_task.sh stable | ||
|
|
||
| Nightly: # 2 jobs, one per lock file. | ||
| name: Test - nightly toolchain | ||
| needs: Prepare | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| dep: [minimal, recent] | ||
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Checkout maintainer tools" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-bitcoin/rust-bitcoin-maintainer-tools | ||
| ref: c3324024ced9bb1eb854397686919c3ff7d97e1e | ||
| path: maintainer-tools | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ needs.Prepare.outputs.nightly_version }} | ||
| - name: "Set dependencies" | ||
| run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | ||
| - name: "Run test script" | ||
| run: ./maintainer-tools/ci/run_task.sh nightly | ||
|
|
||
| MSRV: # 2 jobs, one per lock file. | ||
| name: Test - 1.75.0 toolchain | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| dep: [minimal, recent] | ||
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Checkout maintainer tools" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-bitcoin/rust-bitcoin-maintainer-tools | ||
| path: maintainer-tools | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: "1.75.0" | ||
| - name: "Set dependencies" | ||
| run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | ||
| - name: "Run test script" | ||
| run: ./maintainer-tools/ci/run_task.sh msrv | ||
| - 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 | ||
| needs: Prepare | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BITCOIND_SKIP_DOWNLOAD: "1" | ||
|
|
@@ -106,24 +43,17 @@ jobs: | |
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Checkout maintainer tools" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-bitcoin/rust-bitcoin-maintainer-tools | ||
| ref: c3324024ced9bb1eb854397686919c3ff7d97e1e | ||
| path: maintainer-tools | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ needs.Prepare.outputs.nightly_version }} | ||
| - name: "Install clippy" | ||
| run: rustup component add clippy | ||
| - name: "Set dependencies" | ||
| run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | ||
| - name: "Run test script" | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | ||
| - name: "Run lints" | ||
| run: | | ||
| ./maintainer-tools/ci/run_task.sh lint | ||
| ./contrib/lint-integtation-tests.sh | ||
| cargo rbmt --lock-file ${{ matrix.dep }} lint \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious for feedback on rbmt, does the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. package jsonrpc-fuzz is included and works with rbmt ok from what I've seen. |
||
| -p bitreq \ | ||
| -p corepc-client \ | ||
| -p jsonrpc-fuzz \ | ||
| -p jsonrpc \ | ||
| -p corepc-types | ||
| ./contrib/lint-integration-tests.sh | ||
| ./contrib/lint-verify.sh | ||
|
|
||
| Docs: | ||
|
|
@@ -138,22 +68,13 @@ jobs: | |
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Checkout maintainer tools" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-bitcoin/rust-bitcoin-maintainer-tools | ||
| ref: c3324024ced9bb1eb854397686919c3ff7d97e1e | ||
| path: maintainer-tools | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: "Set dependencies" | ||
| run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | ||
| - name: "Run test script" | ||
| run: ./maintainer-tools/ci/run_task.sh docs | ||
| - 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 | ||
| needs: Prepare | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BITCOIND_SKIP_DOWNLOAD: "1" | ||
|
|
@@ -164,43 +85,26 @@ jobs: | |
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Checkout maintainer tools" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-bitcoin/rust-bitcoin-maintainer-tools | ||
| ref: c3324024ced9bb1eb854397686919c3ff7d97e1e | ||
| path: maintainer-tools | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ needs.Prepare.outputs.nightly_version }} | ||
| - name: "Set dependencies" | ||
| run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | ||
| - name: "Run test script" | ||
| run: ./maintainer-tools/ci/run_task.sh docsrs | ||
| - 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 | ||
| needs: Prepare | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ needs.Prepare.outputs.nightly_version }} | ||
| - name: "Install rustfmt" | ||
| run: rustup component add rustfmt | ||
| - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 | ||
| - name: "Check formatting" | ||
| run: | | ||
| cargo fmt --all -- --check | ||
| 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 | ||
|
|
@@ -247,8 +151,8 @@ jobs: | |
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Select toolchain" | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - 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: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| msrv = "1.75.0" | ||
| too-many-arguments-threshold = 13 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 6560b728ae6a81af9d92713b630ba26772fbd970 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the
msrvtoolchain defined? While a global MSRV might work out right now, I'm not sure this will always be the case asbitreq's TLS dependencies might for example bump MSRV at some point. Would the entire ecosystem / all crates then fine with bumping MSRV, even if they don't share the same dependencies?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @nyonson, do you remember if
[workspace.metadata.rbmt.toolchains]can be overridden with crate-specific config?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
msrvis implicitly picked up from therust-versionkeys in the package manifests. As of today,cargo-rbmthas a limitation where it only works in workspaces with 1 msrv. This can be fixed if needed, just a bit of complexity which hasn't been necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to migrate Floresta to
cargo-rbmtsoon. This would be handy, since the lib crates probably have lower MSRV than the binary itself.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the discussion. For this PR, this is effectively a no-op. I’m happy to follow up with per-crate msrv support once we need it, or once cargo-rbmt supports it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trackin it over here: https://git.rust-bitcoin.org/rust-bitcoin/rust-bitcoin-maintainer-tools/issues/119