Use protobuf-ci for staleness infra.

This will pin our version of Bazel, and avoid non-hermetic breakages from github runner changes

PiperOrigin-RevId: 575277990
pull/14487/head
Mike Kruskal 1 year ago committed by Copybara-Service
parent b7de33ce48
commit 108a4a3094
  1. 18
      .github/workflows/staleness_check.yml
  2. 8
      .github/workflows/staleness_refresh.yml

@ -49,10 +49,14 @@ jobs:
# In branches where automatic updates work as post-submits, we don't want to run staleness # In branches where automatic updates work as post-submits, we don't want to run staleness
# tests along with user changes. Any stale files will be automatically fixed in a follow-up # tests along with user changes. Any stale files will be automatically fixed in a follow-up
# commit. # commit.
run: | uses: protocolbuffers/protobuf-ci/bazel@v2
if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then with:
bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS || \ credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
echo "Please run ./regenerate_stale_files.sh to regenerate stale files" bazel-cache: staleness
else bash: >
bazel query 'attr(tags, "staleness_test", //...)' if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then
fi bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS ||
echo "Please run ./regenerate_stale_files.sh to regenerate stale files";
else
bazel query 'attr(tags, "staleness_test", //...)';
fi

@ -30,6 +30,10 @@ jobs:
# failing then you may need to generate a fresh token. # failing then you may need to generate a fresh token.
token: ${{ secrets.BOT_ACCESS_TOKEN }} token: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Configure name and email address in Git - name: Configure name and email address in Git
run: cd ${{ github.workspace }} && git config user.name "Protobuf Team Bot" && git config user.email "protobuf-team-bot@google.com" run: git config user.name "Protobuf Team Bot" && git config user.email "protobuf-team-bot@google.com"
- name: Commit and push update - name: Commit and push update
run: cd ${{ github.workspace }} && ./ci/push_auto_update.sh uses: protocolbuffers/protobuf-ci/bazel@v2
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: staleness
bash: ci/push_auto_update.sh

Loading…
Cancel
Save