Skip to content

Commit 3077b93

Browse files
authored
Merge pull request #18 from tcharding/12-29-ci
Add CI by way of rust-bitcoin-maintainer-tools
2 parents e0ee3e1 + 76c4a50 commit 3077b93

File tree

6 files changed

+218
-0
lines changed

6 files changed

+218
-0
lines changed

.github/workflows/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# rust-bitcoin workflow notes
2+
3+
We are attempting to run max 20 parallel jobs using GitHub actions (usage limit for free tier).
4+
5+
ref: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
6+
7+
The minimal/recent lock files are handled by CI (`rust.yml`).
8+
9+
## Jobs
10+
11+
Run from rust.yml unless stated otherwise. Unfortunately we are now exceeding the 20 job target.
12+
(Prepare is quick and must be run first anyway.)
13+
14+
0. `Prepare`
15+
1. `Stable - minimal`
16+
2. `Stable - recent`
17+
3. `Nightly - minimal`
18+
4. `Nightly - recent`
19+
5. `MSRV - minimal`
20+
6. `MSRV - recent`
21+
7. `Lint`
22+
8. `Docs`
23+
9. `Docsrs`

.github/workflows/rust.yml

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

Cargo-minimal.lock

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is automatically @generated by Cargo.
2+
# It is not intended for manual editing.
3+
version = 3
4+
5+
[[package]]
6+
name = "ordered"
7+
version = "0.2.2"

Cargo-recent.lock

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is automatically @generated by Cargo.
2+
# It is not intended for manual editing.
3+
version = 3
4+
5+
[[package]]
6+
name = "ordered"
7+
version = "0.2.2"

contrib/crates.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# No shebang, this file should not be executed.
2+
# shellcheck disable=SC2148
3+
#
4+
# disable verify unused vars, despite the fact that they are used when sourced
5+
# shellcheck disable=SC2034
6+
7+
# Crates in this workspace to test.
8+
CRATES=(".")

nightly-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nightly-2024-12-26

0 commit comments

Comments
 (0)