Skip to content

Commit f5efaf9

Browse files
Merge pull request #13017 from protocolbuffers/force-refresh-23
Backport GHA cleanup
2 parents cd78bee + 821c51e commit f5efaf9

File tree

4 files changed

+41
-12
lines changed

4 files changed

+41
-12
lines changed

.github/workflows/staleness_check.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
schedule:
55
# Run daily at 10 AM UTC (2 AM PDT)
66
- cron: 0 10 * * *
7+
workflow_call:
8+
inputs:
9+
safe-checkout:
10+
required: false
11+
description: "The SHA key for the commit we want to run over"
12+
type: string
713
workflow_dispatch:
814

915
permissions: {}
@@ -12,20 +18,32 @@ jobs:
1218
strategy:
1319
fail-fast: false
1420
matrix:
15-
branch: [main, 22.x]
21+
branch: [main, 22.x, 23.x]
1622
os: [{ name: Linux, value: ubuntu-latest}]
1723

1824
name: Test staleness ${{ matrix.os.name }} ${{ matrix.branch}}
1925
runs-on: ${{ matrix.os.value }}
20-
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' || matrix.branch == 'main '}}
26+
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }}
2127
steps:
2228
- name: Checkout ${{ matrix.branch }}
2329
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
2430
with:
25-
ref: ${{ matrix.branch}}
31+
ref: ${{ inputs.safe-checkout || matrix.branch}}
32+
33+
# For commit-based tests, simply run the bazel query to make sure it works. This should be
34+
# identical to the step below, except for the xargs piece that runs bazel test.
35+
- name: Check that staleness tests are queryable
36+
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' || github.event_name == 'push' }}
37+
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
38+
with:
39+
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.0.0-6361b3a6e5c97e9951d03a4de28542fc45f1adab
40+
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
41+
bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }}
42+
bash: bazel query 'attr(tags, "staleness_test", //...)'
2643

2744
- name: Run all staleness tests
28-
uses: protocolbuffers/protobuf-ci/bazel@v1
45+
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' && github.event_name != 'push' }}
46+
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
2947
with:
3048
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
3149
bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }}

.github/workflows/test_cpp.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,16 @@ jobs:
348348
-Dprotobuf_BUILD_SHARED_LIBS=OFF
349349
-Dprotobuf_BUILD_EXAMPLES=ON
350350
vsversion: '2019'
351-
- name: Windows CMake 2022
352-
os: windows-2022
353-
flags: >-
354-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
355-
-Dprotobuf_BUILD_SHARED_LIBS=OFF
356-
-Dprotobuf_BUILD_EXAMPLES=ON
357-
vsversion: '2022'
351+
# TODO(b/285566773) Re-enable this test.
352+
# This is broken due to a github runner update.
353+
# See https://github.com/actions/runner-images/issues/7662 for more details
354+
#- name: Windows CMake 2022
355+
# os: windows-2022
356+
# flags: >-
357+
# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
358+
# -Dprotobuf_BUILD_SHARED_LIBS=OFF
359+
# -Dprotobuf_BUILD_EXAMPLES=ON
360+
# vsversion: '2022'
358361
- name: Windows CMake Shared
359362
os: windows-2019
360363
flags: >-

.github/workflows/test_runner.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,11 @@ jobs:
169169
with:
170170
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
171171
secrets: inherit
172+
173+
staleness:
174+
name: Staleness
175+
needs: [check-tag]
176+
uses: ./.github/workflows/staleness_check.yml
177+
with:
178+
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
179+
secrets: inherit

ci/push_auto_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ fi
4242
git add -A
4343
git diff --staged --quiet || git commit -am "$commit_message"
4444
git pull --rebase
45-
git push || echo "Conflicting commit hit, retrying in next job..."
45+
git push --force-with-lease || echo "Conflicting commit hit, retrying in next job..."

0 commit comments

Comments
 (0)