Skip to content

Commit 901cfbe

Browse files
Cleanup scheduled staleness tests.
- Do some minimal sanity testing on every PR - Only run the staleness tests on a daily schedule or explicit runs. - Add 23.x to the checks PiperOrigin-RevId: 537952151
1 parent 9980541 commit 901cfbe

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
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 != 'schedule' && github.event_name != 'workflow_call'}}
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 == 'schedule' || github.event_name == 'workflow_call' }}
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_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

0 commit comments

Comments
 (0)