Skip to content

Commit 7c862f1

Browse files
committed
Merge #142: ci: copy rust-elements CI setup
7634010 ci: copy rust-elements CI setup (Andrew Poelstra) Pull request description: Fixes #138 This does not include the bitcoind-tests tests. The way we implemented those in rust-miniscript and rust-elements is to commit a bitcoind binary into the repo, which I don't like. Will come up with a better solution. ACKs for top commit: canndrew: ACK 7634010 Tree-SHA512: 48322c0518444811e373228cd24689d931129f0fb437378fc124699c05f4c3b59974402d32d3b5d2e994a236a864eec68cf0e81ba503d5cbe5d12c3ca411e463
2 parents 0ecec39 + 7634010 commit 7c862f1

File tree

7 files changed

+260
-154
lines changed

7 files changed

+260
-154
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Checkout Maintainer Tools
2+
description: Checks out the rust-bitcoin maintainer tools repo
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Checkout maintainer tools
7+
uses: actions/checkout@v4
8+
with:
9+
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
10+
ref: f92b2766865ce5327eca5cf72f86ceaa6be58ca4
11+
path: maintainer-tools

.github/workflows/rust.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
on: # yamllint disable-line rule:truthy
2+
pull_request:
3+
push:
4+
branches:
5+
- master
6+
- 'test-ci/**'
7+
8+
name: Continuous integration
9+
10+
jobs:
11+
Prepare:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
15+
msrv_version: ${{ steps.read_msrv.outputs.msrv_version }}
16+
steps:
17+
- name: "Checkout repo"
18+
uses: actions/checkout@v4
19+
- name: "Read nightly version"
20+
id: read_toolchain
21+
run: |
22+
set -euo pipefail
23+
version=$(cat nightly-version)
24+
echo "nightly_version=$version" >> $GITHUB_OUTPUT
25+
- name: Read MSRV from clippy.toml
26+
id: read_msrv
27+
run: |
28+
set -euo pipefail
29+
msrv=$(grep '^msrv *= *"' clippy.toml | sed -E 's/.*"([^"]+)".*/\1/')
30+
echo "msrv_version=$msrv" >> "$GITHUB_OUTPUT"
31+
32+
Stable:
33+
name: Test - stable toolchain
34+
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
steps:
38+
- name: "Checkout repo"
39+
uses: actions/checkout@v4
40+
- name: "Checkout maintainer tools"
41+
uses: ./.github/actions/checkout-maintainer-tools
42+
- name: "Select toolchain"
43+
uses: dtolnay/rust-toolchain@stable
44+
- name: "Run test script"
45+
run: ./maintainer-tools/ci/run_task.sh stable
46+
47+
Nightly:
48+
name: Test - nightly toolchain
49+
needs: Prepare
50+
runs-on: ubuntu-latest
51+
strategy:
52+
fail-fast: false
53+
steps:
54+
- name: "Checkout repo"
55+
uses: actions/checkout@v4
56+
- name: "Checkout maintainer tools"
57+
uses: ./.github/actions/checkout-maintainer-tools
58+
- name: "Select toolchain"
59+
uses: dtolnay/rust-toolchain@v1
60+
with:
61+
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
62+
- name: "Run test script"
63+
run: ./maintainer-tools/ci/run_task.sh nightly
64+
65+
MSRV:
66+
name: Test - MSRV
67+
needs: Prepare
68+
runs-on: ubuntu-latest
69+
strategy:
70+
fail-fast: false
71+
steps:
72+
- name: "Checkout repo"
73+
uses: actions/checkout@v4
74+
- name: "Checkout maintainer tools"
75+
uses: ./.github/actions/checkout-maintainer-tools
76+
- name: "Select toolchain"
77+
uses: dtolnay/rust-toolchain@stable
78+
with:
79+
toolchain: ${{ needs.Prepare.outputs.msrv_version }}
80+
- name: "Run test script"
81+
run: ./maintainer-tools/ci/run_task.sh msrv
82+
83+
Lint:
84+
name: Lint - nightly toolchain
85+
needs: Prepare
86+
runs-on: ubuntu-latest
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
dep: [recent]
91+
steps:
92+
- name: "Checkout repo"
93+
uses: actions/checkout@v4
94+
- name: "Checkout maintainer tools"
95+
uses: ./.github/actions/checkout-maintainer-tools
96+
- name: "Select toolchain"
97+
uses: dtolnay/rust-toolchain@v1
98+
with:
99+
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
100+
- name: Install clippy
101+
run: rustup component add clippy
102+
- name: "Run test script"
103+
run: ./maintainer-tools/ci/run_task.sh lint
104+
105+
Docs:
106+
name: Docs - stable toolchain
107+
runs-on: ubuntu-latest
108+
strategy:
109+
fail-fast: false
110+
matrix:
111+
dep: [recent]
112+
steps:
113+
- name: "Checkout repo"
114+
uses: actions/checkout@v4
115+
- name: "Checkout maintainer tools"
116+
uses: ./.github/actions/checkout-maintainer-tools
117+
- name: "Select toolchain"
118+
uses: dtolnay/rust-toolchain@stable
119+
- name: "Run test script"
120+
run: ./maintainer-tools/ci/run_task.sh docs
121+
122+
Docsrs:
123+
name: Docs - nightly toolchain
124+
needs: Prepare
125+
runs-on: ubuntu-latest
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
dep: [recent]
130+
steps:
131+
- name: "Checkout repo"
132+
uses: actions/checkout@v4
133+
- name: "Checkout maintainer tools"
134+
uses: ./.github/actions/checkout-maintainer-tools
135+
- name: "Select toolchain"
136+
uses: dtolnay/rust-toolchain@v1
137+
with:
138+
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
139+
- name: "Run test script"
140+
run: ./maintainer-tools/ci/run_task.sh docsrs
141+
142+
Format:
143+
name: Format - nightly toolchain
144+
needs: Prepare
145+
runs-on: ubuntu-latest
146+
strategy:
147+
fail-fast: false
148+
steps:
149+
- name: "Checkout repo"
150+
uses: actions/checkout@v4
151+
- name: "Select toolchain"
152+
uses: dtolnay/rust-toolchain@v1
153+
with:
154+
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
155+
- name: "Install rustfmt"
156+
run: rustup component add rustfmt
157+
- name: "Check formatting"
158+
run: cargo fmt --all -- --check
159+
160+
Wasm:
161+
name: Check WASM
162+
runs-on: ubuntu-latest
163+
strategy:
164+
fail-fast: false
165+
steps:
166+
- name: Checkout Crate
167+
uses: actions/checkout@v3
168+
- name: Checkout Toolchain
169+
uses: dtolnay/rust-toolchain@stable
170+
- run: rustup target add wasm32-unknown-unknown
171+
- run: cargo check --target wasm32-unknown-unknown

.github/workflows/test.yml

Lines changed: 0 additions & 154 deletions
This file was deleted.

contrib/crates.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Sourced by `rust-bitcoin-maintainer-tools/ci/run_task.sh`.
2+
#
3+
# No shebang, this file should not be executed.
4+
# shellcheck disable=SC2148
5+
#
6+
# disable verify unused vars, despite the fact that they are used when sourced
7+
# shellcheck disable=SC2034
8+
9+
CRATES=(. codegen)

0 commit comments

Comments
 (0)