diff --git a/.github/scripts/validate_yaml.py b/.github/scripts/validate_yaml.py index b8b504cc2e4c..c6ebc33a6093 100644 --- a/.github/scripts/validate_yaml.py +++ b/.github/scripts/validate_yaml.py @@ -65,35 +65,3 @@ % (step['name'], job) ) print('PASSED: All steps in all jobs check the continuous-run condition.') - -# Check to make sure the list of included branches matches the list of excluded -# branches in staleness_check.yml. -with open( - os.path.join(os.path.dirname(__file__), '../workflows/staleness_check.yml'), - 'r', -) as f: - regex_pattern = r"'(\d+\.x)'" - data = yaml.safe_load(f) - matrix = data['jobs']['test']['strategy']['matrix'] - included_branches = matrix['branch'] - # Main should be included in all test runs - included_branches.remove('main') - excludes = matrix['exclude'] - for entry in excludes: - match = re.search(regex_pattern, entry['branch']) - branch = match.group(1) - if branch not in included_branches: - raise ValueError( - 'Branch %s is excluded for presubmit runs but is not in the list of' - ' matrix branches in staleness_check.yml.' % branch - ) - included_branches.remove(branch) - if included_branches: - raise ValueError( - 'Branches %s are in the list of matrix branches but do not get excluded' - ' for presubmit runs in staleness_check.yml.' % included_branches - ) - print( - 'PASSED: The list of included branches matches the list of excluded' - ' branches in staleness_check.yml.' - ) diff --git a/.github/workflows/staleness_check.yml b/.github/workflows/staleness_check.yml index 94c3c12f5fa9..72dafb22a478 100644 --- a/.github/workflows/staleness_check.yml +++ b/.github/workflows/staleness_check.yml @@ -20,26 +20,14 @@ on: permissions: {} jobs: test: - strategy: - fail-fast: false - matrix: - # TODO Remove this parameterization once the release branch testing is stable. - branch: [main, 25.x, 28.x, 29.x] - os: [{ name: Linux, value: ubuntu-latest}] - exclude: - # If we are in a presubmit run, only test main - - branch: ${{ !inputs.continuous-run && '25.x' }} - - branch: ${{ !inputs.continuous-run && '28.x' }} - - branch: ${{ !inputs.continuous-run && '29.x' }} - - name: Test staleness ${{ matrix.os.name }} ${{ github.head_ref && 'PR' || matrix.branch }} - runs-on: ${{ matrix.os.value }} + name: Test staleness + runs-on: ubuntu-latest if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }} steps: - - name: Checkout ${{ github.head_ref && 'PR' || matrix.branch }} + - name: Checkout uses: protocolbuffers/protobuf-ci/checkout@v3 with: - ref: ${{ inputs.safe-checkout || github.head_ref || matrix.branch }} + ref: ${{ inputs.safe-checkout || github.head_ref || github.ref }} - name: Mark runs associated with commits if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}