Skip to content

Commit

Permalink
Merge branch 'master' into feat/libp2p-feature-matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger authored Dec 4, 2023
2 parents fb72904 + ce24938 commit ea00156
Show file tree
Hide file tree
Showing 99 changed files with 1,564 additions and 1,874 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ updates:
patterns:
- "opentelemetry*"
- "tracing-opentelemetry"
axum:
patterns:
- "axum"
- "tower"
- "tower-http"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
35 changes: 29 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,31 @@ jobs:
with:
tool: tomlq

- name: Extract version from manifest
run: |
CRATE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version')
echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV
- name: Enforce version in `workspace.dependencies` matches latest version
run: |
PACKAGE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version')
SPECIFIED_VERSION=$(tomlq "workspace.dependencies.$CRATE.version" --file ./Cargo.toml)
echo "Package version: $PACKAGE_VERSION";
echo "Package version: $CRATE_VERSION";
echo "Specified version: $SPECIFIED_VERSION";
test "$PACKAGE_VERSION" = "$SPECIFIED_VERSION" || test "=$PACKAGE_VERSION" = "$SPECIFIED_VERSION"
test "$CRATE_VERSION" = "$SPECIFIED_VERSION" || test "=$CRATE_VERSION" = "$SPECIFIED_VERSION"
- name: Enforce version in CHANGELOG.md matches version in manifest
run: |
MANIFEST_PATH=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .manifest_path')
DIR_TO_CRATE=$(dirname "$MANIFEST_PATH")
VERSION_IN_CHANGELOG=$(awk -F' ' '/^## [0-9]+\.[0-9]+\.[0-9]+/{print $2; exit}' "$DIR_TO_CRATE/CHANGELOG.md")
echo "Package version: $CRATE_VERSION";
echo "Changelog version: $VERSION_IN_CHANGELOG";
test "$CRATE_VERSION" = "$VERSION_IN_CHANGELOG"
- name: Ensure manifest and CHANGELOG are properly updated
if: >
Expand Down Expand Up @@ -311,9 +327,18 @@ jobs:
semver:
runs-on: ubuntu-latest
env:
# Unset the global `RUSTFLAGS` env to allow warnings.
# cargo-semver-checks intentionally re-locks dependency versions
# before checking, and we shouldn't fail here if a dep has a warning.
#
# More context:
# https://github.com/libp2p/rust-libp2p/pull/4932#issuecomment-1829014527
# https://github.com/obi1kenobi/cargo-semver-checks/issues/589
RUSTFLAGS: ''
steps:
- uses: actions/checkout@v4
- run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.24.2/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin
- run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.25.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin
shell: bash
- uses: obi1kenobi/cargo-semver-checks-action@e275dda72e250d4df5b564e969e1348d67fefa52 # v2

Expand Down Expand Up @@ -345,8 +370,6 @@ jobs:
ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")')
FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")')
test "$ALL_FEATURES = $FULL_FEATURE"
echo "$ALL_FEATURES";
echo "$FULL_FEATURE";
Expand Down
Loading

0 comments on commit ea00156

Please sign in to comment.