Merge rust-bitcoin/rust-bitcoin#2969: ci: move semver-checks to its own job

f8c91b067b ci: move semver-checks to its own job (Jose Storopoli)

Pull request description:

  This is necessary because it needs to run only on pull_request, and not on push events.

  Closes #2968.

ACKs for top commit:
  apoelstra:
    ACK f8c91b067b
  tcharding:
    ACK f8c91b067b
  Kixunil:
    ACK f8c91b067b

Tree-SHA512: 31b8817c2cc6aaf4902666140fba51ae1b2f54cc8843eacbe2782dbfca526023c536064351e08b58e5e1d999eb08937a39f619a36e3d9107fd688dea313638d2
This commit is contained in:
merge-script 2024-07-09 17:32:17 +00:00
commit 2320877253
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 39 additions and 32 deletions

View File

@ -303,35 +303,3 @@ jobs:
with:
args: "--only-codegen"
API:
needs: Prepare
name: API - nightly 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: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Install cargo-binstall"
uses: cargo-bins/cargo-binstall@main
- name: "Binstall cargo-semver-checks"
run: cargo binstall cargo-semver-checks --no-confirm
- name: "Run semver checker script"
run: ./contrib/check-semver.sh
- name: "Add PR label to breaking changes"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ hashFiles('semver-break') != '' }}
with:
labels: "API break"
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
if: ${{ hashFiles('semver-break') != '' }}
with:
message: |
:rotating_light: API BREAKING CHANGE DETECTED

39
.github/workflows/semver-checks.yml vendored Normal file
View File

@ -0,0 +1,39 @@
on: # yamllint disable-line rule:truthy
pull_request:
name: Check semver breaks
jobs:
API:
name: API - nightly 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@nightly
- name: "Select nightly-version"
run: |
rustup default $(cat nightly-version)
- name: "Install cargo-binstall"
uses: cargo-bins/cargo-binstall@main
- name: "Binstall cargo-semver-checks"
run: cargo binstall cargo-semver-checks --no-confirm
- name: "Run semver checker script"
run: ./contrib/check-semver.sh
- name: "Add PR label to breaking changes"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ hashFiles('semver-break') != '' }}
with:
labels: "API break"
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
if: ${{ hashFiles('semver-break') != '' }}
with:
message: |
:rotating_light: API BREAKING CHANGE DETECTED