Skip to content

Commit

Permalink
ci/nightly: Add a dependency mismatcher job
Browse files Browse the repository at this point in the history
Add a dependency mismatcher job that checks whether any dependencies
have more than one versions.

Signed-off-by: Tomás González <[email protected]>
  • Loading branch information
tgonzalezorlandoarm committed Nov 24, 2023
1 parent 3126913 commit 84b258e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,20 @@ jobs:
run: cargo install cargo-audit
- name: Execute cargo audit
run: cargo audit

mismatcher:
name: Check for mismatched dependencies (those that have more than one version)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Install Rust MSRV
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
rustflags: ""
- name: Execute CI script
uses: ./.github/actions/ci_script
with:
ci-flags: "mismatcher"
34 changes: 34 additions & 0 deletions tests/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,44 @@

set -xeuf -o pipefail

error_msg () {
echo "Error: $1"
exit 1
}

# Points to Parsec's Unix Domain Socket on the CI
export PARSEC_SERVICE_ENDPOINT="unix:/tmp/parsec.sock"
export RUST_LOG=error

##################
# Get Parameters #
##################
MISMATCHER=
while [ "$#" -gt 0 ]; do
case "$1" in
mismatcher )
MISMATCHER="True"
;;
*)
error_msg "Unknown argument: $1"
;;
esac
shift
done

#########################
# Dependency mismatcher #
#########################
if [ "$MISMATCHER" = "True" ]; then
python3 $(pwd)/utils/dependency_cross_matcher.py --deps_dir $(pwd)
mismatcher_result=$?
if [ "$mismatcher_result" -ne 0 ]; then
error_msg "Found dependencies version mismatches"
fi

exit 0
fi

#########
# Build #
#########
Expand Down

0 comments on commit 84b258e

Please sign in to comment.