|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +# |
| 19 | + |
| 20 | +name: CI - Python Functions |
| 21 | +on: |
| 22 | + pull_request: |
| 23 | + branches: |
| 24 | + - master |
| 25 | + paths: |
| 26 | + - '.github/workflows/**' |
| 27 | + - 'pulsar-functions/instance/src/main/python/**' |
| 28 | + - 'pulsar-functions/instance/src/test/python/**' |
| 29 | + - 'pulsar-functions/instance/src/scripts/**' |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +concurrency: |
| 33 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 34 | + cancel-in-progress: true |
| 35 | + |
| 36 | +jobs: |
| 37 | + preconditions: |
| 38 | + name: Preconditions |
| 39 | + runs-on: ubuntu-24.04 |
| 40 | + outputs: |
| 41 | + docs_only: ${{ steps.check_changes.outputs.docs_only }} |
| 42 | + steps: |
| 43 | + - name: checkout |
| 44 | + uses: actions/checkout@v6 |
| 45 | + |
| 46 | + - name: Detect changed files |
| 47 | + id: changes |
| 48 | + uses: apache/pulsar-test-infra/paths-filter@master |
| 49 | + with: |
| 50 | + filters: .github/changes-filter.yaml |
| 51 | + list-files: csv |
| 52 | + |
| 53 | + - name: Check changed files |
| 54 | + id: check_changes |
| 55 | + run: | |
| 56 | + if [[ "${GITHUB_EVENT_NAME}" != "schedule" ]]; then |
| 57 | + echo "docs_only=${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}" >> $GITHUB_OUTPUT |
| 58 | + else |
| 59 | + echo docs_only=false >> $GITHUB_OUTPUT |
| 60 | + fi |
| 61 | +
|
| 62 | + - name: Check if the PR is ready for running CI |
| 63 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }} |
| 64 | + uses: ./.github/actions/check-pr-ready-to-test |
| 65 | + |
| 66 | + instance-tests: |
| 67 | + needs: preconditions |
| 68 | + if: ${{ needs.preconditions.outputs.docs_only != 'true' }} |
| 69 | + name: Python ${{ matrix.python-version }} Functions instance tests |
| 70 | + runs-on: ubuntu-24.04 |
| 71 | + strategy: |
| 72 | + fail-fast: false |
| 73 | + matrix: |
| 74 | + python-version: ['3.12', '3.13'] |
| 75 | + |
| 76 | + steps: |
| 77 | + - name: checkout |
| 78 | + uses: actions/checkout@v6 |
| 79 | + |
| 80 | + - name: Tune Runner VM |
| 81 | + uses: ./.github/actions/tune-runner-vm |
| 82 | + |
| 83 | + - name: Set up Python |
| 84 | + uses: actions/setup-python@v6 |
| 85 | + with: |
| 86 | + python-version: ${{ matrix.python-version }} |
| 87 | + |
| 88 | + - name: Run Python instance tests |
| 89 | + run: | |
| 90 | + ./pulsar-functions/instance/src/scripts/run_python_instance_tests.sh |
0 commit comments