|
1 | | -on: # yamllint disable-line rule:truthy |
2 | | - pull_request: |
3 | | - push: |
4 | | - branches: |
5 | | - - master |
6 | | - - 'test-ci/**' |
| 1 | +on: [push, pull_request] |
7 | 2 |
|
8 | | -name: Continuous integration |
| 3 | +name: Continuous Integration |
9 | 4 |
|
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: "Set dependencies" |
45 | | - run: cp Cargo-latest.lock Cargo.lock |
46 | | - - name: "Run test script" |
47 | | - run: ./maintainer-tools/ci/run_task.sh stable |
48 | | - |
49 | | - Nightly: |
50 | | - name: Test - nightly toolchain |
51 | | - needs: Prepare |
52 | | - runs-on: ubuntu-latest |
53 | | - strategy: |
54 | | - fail-fast: false |
55 | | - steps: |
56 | | - - name: "Checkout repo" |
57 | | - uses: actions/checkout@v4 |
58 | | - - name: "Checkout maintainer tools" |
59 | | - uses: ./.github/actions/checkout-maintainer-tools |
60 | | - - name: "Select toolchain" |
61 | | - uses: dtolnay/rust-toolchain@v1 |
62 | | - with: |
63 | | - toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
64 | | - - name: "Set dependencies" |
65 | | - run: cp Cargo-latest.lock Cargo.lock |
66 | | - - name: "Run test script" |
67 | | - run: ./maintainer-tools/ci/run_task.sh nightly |
| 5 | +permissions: |
| 6 | + contents: read |
68 | 7 |
|
69 | | - MSRV: |
70 | | - name: Test - MSRV |
71 | | - needs: Prepare |
72 | | - runs-on: ubuntu-latest |
| 8 | +jobs: |
| 9 | + Test: # 6 jobs: 3 toolchains × 2 lock files. |
| 10 | + name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }}) |
| 11 | + runs-on: ubuntu-24.04 |
73 | 12 | strategy: |
74 | 13 | fail-fast: false |
| 14 | + matrix: |
| 15 | + dep: [recent] |
| 16 | + toolchain: [stable, nightly, msrv] |
75 | 17 | steps: |
76 | | - - name: "Checkout repo" |
| 18 | + - name: Checkout repo |
77 | 19 | uses: actions/checkout@v4 |
78 | | - - name: "Checkout maintainer tools" |
79 | | - uses: ./.github/actions/checkout-maintainer-tools |
80 | | - - name: "Select toolchain" |
81 | | - uses: dtolnay/rust-toolchain@stable |
82 | | - with: |
83 | | - toolchain: ${{ needs.Prepare.outputs.msrv_version }} |
84 | | - - name: "Set dependencies" |
85 | | - run: cp Cargo-latest.lock Cargo.lock |
86 | | - - name: "Run test script" |
87 | | - run: ./maintainer-tools/ci/run_task.sh msrv |
| 20 | + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0 |
| 21 | + - uses: Swatinem/rust-cache@v2 |
| 22 | + - name: Run ${{ matrix.toolchain }} tests |
| 23 | + run: | |
| 24 | + export ELEMENTSD_EXE="$PWD/elementsd-tests/bin/elementsd" |
| 25 | + if [ "${{ matrix.toolchain }}" = "msrv" ]; then |
| 26 | + MSRV="$(cargo rbmt toolchains --msrv)" |
| 27 | + cp "Cargo-${{ matrix.dep }}.lock" Cargo.lock |
| 28 | + cargo +"$MSRV" test --locked |
| 29 | + else |
| 30 | + cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }} |
| 31 | + fi |
88 | 32 |
|
89 | 33 | Lint: |
90 | 34 | name: Lint - nightly toolchain |
91 | | - needs: Prepare |
92 | | - runs-on: ubuntu-latest |
93 | | - strategy: |
94 | | - fail-fast: false |
95 | | - matrix: |
96 | | - dep: [recent] |
| 35 | + runs-on: ubuntu-24.04 |
97 | 36 | steps: |
98 | | - - name: "Checkout repo" |
| 37 | + - name: Checkout Crate |
99 | 38 | uses: actions/checkout@v4 |
100 | | - - name: "Checkout maintainer tools" |
101 | | - uses: ./.github/actions/checkout-maintainer-tools |
102 | | - - name: "Select toolchain" |
103 | | - uses: dtolnay/rust-toolchain@v1 |
104 | | - with: |
105 | | - toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
106 | | - - name: Install clippy |
107 | | - run: rustup component add clippy |
108 | | - - name: "Set dependencies" |
109 | | - run: cp Cargo-latest.lock Cargo.lock |
110 | | - - name: "Run test script" |
111 | | - run: ./maintainer-tools/ci/run_task.sh lint |
| 39 | + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0 |
| 40 | + - uses: Swatinem/rust-cache@v2 |
| 41 | + - name: Run lints |
| 42 | + run: cargo rbmt --lock-file recent lint |
112 | 43 |
|
113 | 44 | Docs: |
114 | 45 | name: Docs - stable toolchain |
115 | | - runs-on: ubuntu-latest |
116 | | - strategy: |
117 | | - fail-fast: false |
118 | | - matrix: |
119 | | - dep: [recent] |
| 46 | + runs-on: ubuntu-24.04 |
120 | 47 | steps: |
121 | | - - name: "Checkout repo" |
| 48 | + - name: Checkout Crate |
122 | 49 | uses: actions/checkout@v4 |
123 | | - - name: "Checkout maintainer tools" |
124 | | - uses: ./.github/actions/checkout-maintainer-tools |
125 | | - - name: "Select toolchain" |
126 | | - uses: dtolnay/rust-toolchain@stable |
127 | | - - name: "Set dependencies" |
128 | | - run: cp Cargo-latest.lock Cargo.lock |
129 | | - - name: "Run test script" |
130 | | - run: ./maintainer-tools/ci/run_task.sh docs |
| 50 | + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0 |
| 51 | + - uses: Swatinem/rust-cache@v2 |
| 52 | + - name: Run doc tests |
| 53 | + run: cargo rbmt --lock-file recent docs |
131 | 54 |
|
132 | 55 | Docsrs: |
133 | 56 | name: Docs - nightly toolchain |
134 | | - needs: Prepare |
135 | | - runs-on: ubuntu-latest |
136 | | - strategy: |
137 | | - fail-fast: false |
138 | | - matrix: |
139 | | - dep: [recent] |
| 57 | + runs-on: ubuntu-24.04 |
140 | 58 | steps: |
141 | | - - name: "Checkout repo" |
| 59 | + - name: Checkout Crate |
142 | 60 | uses: actions/checkout@v4 |
143 | | - - name: "Checkout maintainer tools" |
144 | | - uses: ./.github/actions/checkout-maintainer-tools |
145 | | - - name: "Select toolchain" |
146 | | - uses: dtolnay/rust-toolchain@v1 |
147 | | - with: |
148 | | - toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
149 | | - - name: "Set dependencies" |
150 | | - run: cp Cargo-latest.lock Cargo.lock |
151 | | - - name: "Run test script" |
152 | | - run: ./maintainer-tools/ci/run_task.sh docsrs |
| 61 | + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0 |
| 62 | + - uses: Swatinem/rust-cache@v2 |
| 63 | + - name: Run docsrs tests |
| 64 | + run: cargo rbmt --lock-file recent docsrs |
153 | 65 |
|
154 | | -# Format: |
| 66 | +# Format: # 1 job, run cargo fmt directly. |
155 | 67 | # name: Format - nightly toolchain |
156 | | -# needs: Prepare |
157 | | -# runs-on: ubuntu-latest |
158 | | -# strategy: |
159 | | -# fail-fast: false |
| 68 | +# runs-on: ubuntu-24.04 |
160 | 69 | # steps: |
161 | | -# - name: "Checkout repo" |
| 70 | +# - name: Checkout Crate |
162 | 71 | # uses: actions/checkout@v4 |
163 | | -# - name: "Select toolchain" |
164 | | -# uses: dtolnay/rust-toolchain@v1 |
165 | | -# with: |
166 | | -# toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
167 | | -# - name: "Install rustfmt" |
168 | | -# run: rustup component add rustfmt |
169 | | -# - name: "Check formatting" |
170 | | -# run: cargo fmt --all -- --check |
| 72 | +# - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0 |
| 73 | +# - name: Check formatting |
| 74 | +# run: cargo rbmt --lock-file recent fmt --check |
| 75 | + |
| 76 | + Bench: |
| 77 | + name: Bench - nightly toolchain |
| 78 | + runs-on: ubuntu-24.04 |
| 79 | + steps: |
| 80 | + - name: Checkout Crate |
| 81 | + uses: actions/checkout@v4 |
| 82 | + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0 |
| 83 | + - uses: Swatinem/rust-cache@v2 |
| 84 | + - name: Run benches |
| 85 | + run: cargo rbmt --lock-file recent bench |
| 86 | + |
| 87 | + Arch32bit: |
| 88 | + name: Test 32-bit version |
| 89 | + runs-on: ubuntu-24.04 |
| 90 | + steps: |
| 91 | + - name: Checkout Crate |
| 92 | + uses: actions/checkout@v4 |
| 93 | + - name: Checkout Toolchain |
| 94 | + uses: dtolnay/rust-toolchain@stable |
| 95 | + - name: Add architecture i386 |
| 96 | + run: sudo dpkg --add-architecture i386 |
| 97 | + - name: Install i686 gcc |
| 98 | + run: sudo apt-get update -y && sudo apt-get install -y gcc-multilib |
| 99 | + - name: Install target |
| 100 | + run: rustup target add i686-unknown-linux-gnu |
| 101 | + - name: Run tests on i686 |
| 102 | + run: cargo test --target i686-unknown-linux-gnu |
| 103 | + |
| 104 | + Cross: |
| 105 | + name: Cross test |
| 106 | + runs-on: ubuntu-24.04 |
| 107 | + steps: |
| 108 | + - name: Checkout Crate |
| 109 | + uses: actions/checkout@v4 |
| 110 | + - name: Checkout Toolchain |
| 111 | + uses: dtolnay/rust-toolchain@stable |
| 112 | + - name: Install target |
| 113 | + run: rustup target add s390x-unknown-linux-gnu |
| 114 | + - name: install cross |
| 115 | + run: cargo install cross --locked |
| 116 | + - name: run cross test |
| 117 | + run: cross test --target s390x-unknown-linux-gnu |
171 | 118 |
|
172 | 119 | Wasm: |
173 | 120 | name: Check WASM |
|
0 commit comments