@ -4,6 +4,12 @@ on:
schedule:
schedule:
# Run daily at 10 AM UTC (2 AM PDT)
# Run daily at 10 AM UTC (2 AM PDT)
- cron : 0 10 * * *
- 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:
workflow_dispatch:
permissions : {}
permissions : {}
@ -12,20 +18,31 @@ jobs:
strategy:
strategy:
fail-fast : false
fail-fast : false
matrix:
matrix:
branch : [ main, 22.x]
branch : [ main, 22.x, 23.x ]
os : [ { name: Linux, value : ubuntu-latest}]
os : [ { name: Linux, value : ubuntu-latest}]
name : Test staleness ${{ matrix.os.name }} ${{ matrix.branch}}
name : Test staleness ${{ matrix.os.name }} ${{ matrix.branch}}
runs-on : ${{ matrix.os.value }}
runs-on : ${{ matrix.os.value }}
if : ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }}
steps:
steps:
- name : Checkout ${{ matrix.branch }}
- name : Checkout ${{ matrix.branch }}
if : ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' || matrix.branch == 'main '}}
uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
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 != 'schedule' && github.event_name != 'workflow_call'}}
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
- name : Run all staleness tests
if : ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' || matrix.branch == 'main '}}
if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_call' }}
uses : protocolbuffers/protobuf-ci/bazel-docker@v1
uses : protocolbuffers/protobuf-ci/bazel-docker@v1
with:
with:
image : us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.0.0-6361b3a6e5c97e9951d03a4de28542fc45f1adab
image : us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.0.0-6361b3a6e5c97e9951d03a4de28542fc45f1adab