diff --git a/.github/scripts/validate_yaml.py b/.github/scripts/validate_yaml.py index c6ebc33a60..fba273fc6e 100644 --- a/.github/scripts/validate_yaml.py +++ b/.github/scripts/validate_yaml.py @@ -53,15 +53,21 @@ for file in yaml_files: continuous_condition = 'inputs.continuous-prefix' in jobs[job]['name'] steps = jobs[job]['steps'] for step in steps: + if 'name' in step: + name = step['name'] + elif 'with' in step and 'name' in step['with']: + name = step['with']['name'] + else: + raise ValueError('Step in job %s does not have a name.' % job) if continuous_condition and 'continuous-run' not in step.get('if', ''): raise ValueError( 'Step %s in job %s does not check the continuous-run condition' - % (step['name'], job) + % (name, job) ) if not continuous_condition and 'continuous-run' in step.get('if', ''): raise ValueError( 'Step %s in job %s checks the continuous-run condition but ' 'the job does not contain the continuous-prefix' - % (step['name'], job) + % (name, job) ) print('PASSED: All steps in all jobs check the continuous-run condition.') diff --git a/.github/workflows/test_upb.yml b/.github/workflows/test_upb.yml index fe0f37dc69..678e2be05f 100644 --- a/.github/workflows/test_upb.yml +++ b/.github/workflows/test_upb.yml @@ -87,8 +87,9 @@ jobs: uses: protocolbuffers/protobuf-ci/checkout@v3 with: ref: ${{ inputs.safe-checkout }} - - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 - with: + - name: "Setup Python" + uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 + with: cache: pip cache-dependency-path: 'python/requirements.txt' - name: Run tests @@ -114,7 +115,8 @@ jobs: uses: protocolbuffers/protobuf-ci/checkout@v3 with: ref: ${{ inputs.safe-checkout }} - - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 + - name: "Setup Python" + uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 with: cache: pip cache-dependency-path: 'python/requirements.txt' @@ -225,7 +227,8 @@ jobs: with: name: requirements path: requirements - - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 + - name: Setup Python + uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 if: ${{ !matrix.continuous-only || inputs.continuous-run }} with: python-version: ${{ matrix.python-version }} @@ -286,7 +289,8 @@ jobs: path: wheels - name: Delete Binary Wheels run: find wheels -type f | grep -v none-any | xargs rm - - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 + - name: "Setup Python" + uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 with: python-version: ${{ matrix.python-version }} - name: Setup Python venv