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
915permissions : {}
@@ -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 }}
0 commit comments