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 Sep 30, 2022
1 parent 2025de3 commit 09e2ef6
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -187,3 +187,41 @@ jobs:

- name: Check formatting
run: cargo fmt -- --check

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' | jq -s | jq -c '.')
echo "::set-output name=members::${WORKSPACE_MEMBERS}"
semver-check:
runs-on: ubuntu-latest
needs: gather_workspace_members
strategy:
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: nightly
profile: minimal

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

- run: cargo install cargo-semver-checks

- uses: Swatinem/rust-cache@v2

- name: Semver Check
if: ${{ matrix.crate != 'libp2p' && contains(matrix.crate, 'libp2p') }}
run: cargo semver-checks check-release -p ${{ matrix.crate }}

0 comments on commit 09e2ef6

Please sign in to comment.