forked from rust-bitcoin/rust-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 2.17 KB
/
semver-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
on: # yamllint disable-line rule:truthy
pull_request:
name: Check semver breaks
jobs:
PR:
name: PR Semver - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
fetch-depth: 0 # we need full history for cargo semver-checks
- name: "Install Rustup"
uses: dtolnay/rust-toolchain@stable
- name: "Select stable-version"
run: |
rustup default $(cat ./.github/workflows/stable-version)
- name: "Install cargo-binstall"
uses: cargo-bins/cargo-binstall@main
- name: "Binstall pinned cargo-semver-checks"
run: cargo binstall cargo-semver-checks@$(cat ./.github/workflows/cargo-semver-checks-version) --no-confirm
- name: "Run semver checker script"
run: ./contrib/check-semver-pr.sh
- name: Save PR number
if: ${{ hashFiles('semver-break') != '' }}
env:
PR_NUMBER: ${{ github.event.number }}
run: |
# check if PR_NUMBER is a number
if ! [[ "$PR_NUMBER" =~ ^-?[0-9]+$ ]]; then
echo "$PR_NUMBER is not a number."
exit 1
fi
echo "$PR_NUMBER" > ./semver-break
- name: "Save breaking state"
if: ${{ hashFiles('semver-break') != '' }}
uses: actions/upload-artifact@v4
with:
name: semver-break
path: semver-break
Feature:
name: Non additive cargo features - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Install Rustup"
uses: dtolnay/rust-toolchain@stable
- name: "Select stable-version"
run: |
rustup default $(cat ./.github/workflows/stable-version)
- name: "Install cargo-binstall"
uses: cargo-bins/cargo-binstall@main
- name: "Binstall pinned cargo-semver-checks"
run: cargo binstall cargo-semver-checks@$(cat ./.github/workflows/cargo-semver-checks-version) --no-confirm
- name: "Run semver checker script"
run: ./contrib/check-semver-feature.sh