Skip to content

Commit

Permalink
ci: Assorted fixes for scheduled runs (#26777)
Browse files Browse the repository at this point in the history
- filter example
- clang_tidy

Signed-off-by: Ryan Northey <ryan@synca.io>
  • Loading branch information
phlax authored Apr 16, 2023
1 parent 4c12d8e commit 8e4835e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ci/filter_example_mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ if [[ "${AZP_BRANCH}" == "${MAIN_BRANCH}" ]]; then
echo "Updating Submodule..."
# Update submodule to latest Envoy SHA
ENVOY_SHA=$(git rev-parse HEAD)
CURRENT_SHA="$(git -C "$CHECKOUT_DIR" ls-files -s envoy | cut -d' ' -f2)"

if [[ "$CURRENT_SHA" == "$ENVOY_SHA" ]]; then
echo "Submodule already up to date (${ENVOY_SHA})"
exit 0
fi

git -C "$CHECKOUT_DIR" submodule update --init
git -C "$CHECKOUT_DIR/envoy" checkout "$ENVOY_SHA"

echo "Updating Workspace file."
sed -e "s|{ENVOY_SRCDIR}|envoy|" "${ENVOY_SRCDIR}"/ci/WORKSPACE.filter.example > "${CHECKOUT_DIR}"/WORKSPACE

echo "Committing, and Pushing..."
if git -C "$CHECKOUT_DIR" status --porcelain; then
git -C "$CHECKOUT_DIR" commit -a -m "Update Envoy submodule to $ENVOY_SHA"
git -C "$CHECKOUT_DIR" push origin "${FILTER_EXAMPLE_MAIN_BRANCH}"
echo "Done"
else
# There can be no changes, eg in a scheduled run.
echo "Nothing to commit"
fi
git -C "$CHECKOUT_DIR" commit -a -m "Update Envoy submodule to $ENVOY_SHA"
git -C "$CHECKOUT_DIR" push origin "${FILTER_EXAMPLE_MAIN_BRANCH}"
echo "Done"
fi
6 changes: 6 additions & 0 deletions ci/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ else
DIFF_REF=$("${ENVOY_SRCDIR}"/tools/git/last_github_commit.sh)
fi
fi
if [[ "${DIFF_REF}" == "${DIFF_HEAD}" ]]; then
# TODO(phlax): either skip this altogether in scheduled runs or run full clang tidy
echo "Nothing changed"
exit 0
fi

echo "Running clang-tidy-diff against ${DIFF_REF} ($(git rev-parse "${DIFF_REF}")), current HEAD ($(git rev-parse "${DIFF_HEAD}"))"
run_clang_tidy_diff "${DIFF_REF}"
fi
Expand Down

0 comments on commit 8e4835e

Please sign in to comment.