Skip to content

Commit

Permalink
Merge pull request #13017 from protocolbuffers/force-refresh-23
Browse files Browse the repository at this point in the history
Backport GHA cleanup
  • Loading branch information
mkruskal-google authored Jun 9, 2023
2 parents cd78bee + 821c51e commit f5efaf9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/staleness_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
schedule:
# Run daily at 10 AM UTC (2 AM PDT)
- cron: 0 10 * * *
workflow_call:
inputs:
safe-checkout:
required: false
description: "The SHA key for the commit we want to run over"
type: string
workflow_dispatch:

permissions: {}
Expand All @@ -12,20 +18,32 @@ jobs:
strategy:
fail-fast: false
matrix:
branch: [main, 22.x]
branch: [main, 22.x, 23.x]
os: [{ name: Linux, value: ubuntu-latest}]

name: Test staleness ${{ matrix.os.name }} ${{ matrix.branch}}
runs-on: ${{ matrix.os.value }}
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' || matrix.branch == 'main '}}
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }}
steps:
- name: Checkout ${{ matrix.branch }}
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ matrix.branch}}
ref: ${{ inputs.safe-checkout || matrix.branch}}

# For commit-based tests, simply run the bazel query to make sure it works. This should be
# identical to the step below, except for the xargs piece that runs bazel test.
- name: Check that staleness tests are queryable
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' || github.event_name == 'push' }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.0.0-6361b3a6e5c97e9951d03a4de28542fc45f1adab
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }}
bash: bazel query 'attr(tags, "staleness_test", //...)'

- name: Run all staleness tests
uses: protocolbuffers/protobuf-ci/bazel@v1
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' && github.event_name != 'push' }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/test_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,16 @@ jobs:
-Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019'
- name: Windows CMake 2022
os: windows-2022
flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2022'
# TODO(b/285566773) Re-enable this test.
# This is broken due to a github runner update.
# See https://github.com/actions/runner-images/issues/7662 for more details
#- name: Windows CMake 2022
# os: windows-2022
# flags: >-
# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
# -Dprotobuf_BUILD_SHARED_LIBS=OFF
# -Dprotobuf_BUILD_EXAMPLES=ON
# vsversion: '2022'
- name: Windows CMake Shared
os: windows-2019
flags: >-
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,11 @@ jobs:
with:
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
secrets: inherit

staleness:
name: Staleness
needs: [check-tag]
uses: ./.github/workflows/staleness_check.yml
with:
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
secrets: inherit
2 changes: 1 addition & 1 deletion ci/push_auto_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ fi
git add -A
git diff --staged --quiet || git commit -am "$commit_message"
git pull --rebase
git push || echo "Conflicting commit hit, retrying in next job..."
git push --force-with-lease || echo "Conflicting commit hit, retrying in next job..."

0 comments on commit f5efaf9

Please sign in to comment.