Skip to content

Commit

Permalink
CI: Use script from rust-bitcoin-maintainer-tools
Browse files Browse the repository at this point in the history
We have a CI script in the `rust-bitcoin-maintainer-tools` repository,
lets use it.

Requires adding `Cargo-minimal.lock` and `Cargo-recent.lock`. Both these
lock files are tested with all three toolchains (msrv, stable, nightly).

Note, I could not find a more recent set of dependencies that works so
the two lock files are the same.
  • Loading branch information
tcharding committed May 7, 2024
1 parent 41c457e commit fcde06b
Show file tree
Hide file tree
Showing 10 changed files with 1,224 additions and 74 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# rust-miniscript workflow notes

We are attempting to run max 20 parallel jobs using GitHub actions (usage limit for free tier).

ref: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration

The minimal/recent lock files are handled by CI (`rust.yml`).

## Jobs

Run from `rust.yml` unless stated otherwise. Total 11 jobs.

1. `Stable - minimal`
2. `Stable - recent`
3. `Nightly - minimal`
4. `Nightly - recent`
5. `MSRV - minimal`
6. `Integration - 0.18.0`
7. `Integration - 0.18.1`
8. `Integration - 0.19.0.1`
9. `Integration - 0.19.1`
10. `Integration - 0.20.0`
11. `Integration - 0.21.0`
117 changes: 81 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,91 @@
on: [push, pull_request]
--- # rust-bitcoincore-rpc 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:
tests:
name: Tests
Stable: # 2 jobs, one per lock file.
name: Test - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rust: stable
env:
RUSTFMTCHK: true
- rust: nightly
env:
RUSTFMTCHK: false
- rust: 1.56.1
env:
RUSTFMTCHK: false
dep: [minimal, recent]
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Running test script
env: ${{ matrix.env }}
run: ./contrib/test.sh
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
rev: b2ac115
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

integrations-tests:
name: Integration Tests
Nightly: # 2 jobs, one per lock file.
name: Test - nightly 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
rev: b2ac115
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@nightly
- 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.56.1 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
rev: b2ac115
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.56.1"
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh msrv

Integration: # 1 job for each Bitcoin Core version.
name: Integration tests - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [stable]
bitcoinversion:
[
"0.18.0",
Expand All @@ -48,15 +97,11 @@ jobs:
"0.21.0",
]
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Running test script
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Run integration tests"
env:
BITCOINVERSION: ${{ matrix.bitcoinversion }}
run: ./contrib/test.sh
run: ./contrib/integration_test.sh
Loading

0 comments on commit fcde06b

Please sign in to comment.