Skip to content

Commit

Permalink
.github/: Enforce semantic versioning using cargo-semver-checks (libp…
Browse files Browse the repository at this point in the history
  • Loading branch information
maschad committed Oct 1, 2022
1 parent 1da75b2 commit 9002ae3
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -211,3 +211,42 @@ jobs:
FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")')
test "$ALL_FEATURES = $FULL_FEATURE"
gather_workspace_members:
runs-on: ubuntu-latest
outputs:
members: ${{ steps.cargo-metadata.outputs.members }}
steps:
- uses: actions/checkout@v3

- id: cargo-metadata
run: |
WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages |.[] | .name'| grep 'libp2p-' | jq -s | jq -c '.')
echo "::set-output name=members::${WORKSPACE_MEMBERS}"
semver-check:
runs-on: ubuntu-latest
needs: gather_workspace_members
strategy:
fail-fast: false
matrix:
crate: ${{ fromJSON(needs.gather_workspace_members.outputs.members) }}
steps:
- uses: actions/checkout@v3

- name: Install rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Install Protoc
uses: arduino/setup-protoc@v1

- uses: Swatinem/rust-cache@v2

- run: cargo install cargo-semver-checks

- name: Semver Check
if: ${{ matrix.crate }}
run: cargo semver-checks check-release -p ${{ matrix.crate }}

0 comments on commit 9002ae3

Please sign in to comment.