Skip to content

Commit 655d580

Browse files
committed
Add SemVer compatibility checks to CI
We recently introduced release branches that need to remain backwards compatible. However, even small changes to item visibility during backporting fixes might introduce SemVer violations (see https://doc.rust-lang.org/cargo/reference/semver.html#change-categories for a list of changs that would be considered major/minor). To make sure we don't accidentally introduce such changes in the backports, we here add a new `semver-checks` CI job that utilizes `cargo-semver-checks` (https://github.com/obi1kenobi/cargo-semver-checks), and have it run on any push or pull requests towards anything else but `main`/`master` (i.e., all feature branches to come).
1 parent a91196b commit 655d580

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/semver.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: SemVer checks
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
pull_request:
7+
branches-ignore:
8+
- master
9+
10+
jobs:
11+
semver-checks:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source code
15+
uses: actions/checkout@v4
16+
- name: Install Rust stable toolchain
17+
run: |
18+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
19+
rustup override set stable
20+
- name: Check SemVer with default features
21+
uses: obi1kenobi/cargo-semver-checks-action@v2
22+
with:
23+
feature-group: default-features
24+
- name: Check SemVer *without* default features
25+
uses: obi1kenobi/cargo-semver-checks-action@v2
26+
with:
27+
feature-group: only-explicit-features
28+
- name: Check lightning-background-processor SemVer
29+
uses: obi1kenobi/cargo-semver-checks-action@v2
30+
with:
31+
package: lightning-background-processor
32+
feature-group: only-explicit-features
33+
features: futures
34+
- name: Check lightning-block-sync SemVer
35+
uses: obi1kenobi/cargo-semver-checks-action@v2
36+
with:
37+
package: lightning-block-sync
38+
feature-group: only-explicit-features
39+
features: rpc-client,rest-client
40+
- name: Check lightning-transaction-sync electrum SemVer
41+
uses: obi1kenobi/cargo-semver-checks-action@v2
42+
with:
43+
manifest-path: lightning-transaction-sync/Cargo.toml
44+
feature-group: only-explicit-features
45+
features: electrum
46+
- name: Check lightning-transaction-sync esplora-blocking SemVer
47+
uses: obi1kenobi/cargo-semver-checks-action@v2
48+
with:
49+
manifest-path: lightning-transaction-sync/Cargo.toml
50+
feature-group: only-explicit-features
51+
features: esplora-blocking
52+
- name: Check lightning-transaction-sync esplora-async SemVer
53+
uses: obi1kenobi/cargo-semver-checks-action@v2
54+
with:
55+
manifest-path: lightning-transaction-sync/Cargo.toml
56+
feature-group: only-explicit-features
57+
features: esplora-async

0 commit comments

Comments
 (0)