|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | +# |
| 18 | +--- |
| 19 | +name: Integration and system tests |
| 20 | +on: # yamllint disable-line rule:truthy |
| 21 | + workflow_call: |
| 22 | + inputs: |
| 23 | + runs-on-as-json-public: |
| 24 | + description: "The array of labels (in json form) determining public runners." |
| 25 | + required: true |
| 26 | + type: string |
| 27 | + image-tag: |
| 28 | + description: "Tag to set for the image" |
| 29 | + required: true |
| 30 | + type: string |
| 31 | + testable-core-integrations: |
| 32 | + description: "The list of testable core integrations as JSON array." |
| 33 | + required: true |
| 34 | + type: string |
| 35 | + testable-providers-integrations: |
| 36 | + description: "The list of testable providers integrations as JSON array." |
| 37 | + required: true |
| 38 | + type: string |
| 39 | + run-system-tests: |
| 40 | + description: "Run system tests (true/false)" |
| 41 | + required: true |
| 42 | + type: string |
| 43 | + default-postgres-version: |
| 44 | + description: "Default version of Postgres to use" |
| 45 | + required: true |
| 46 | + type: string |
| 47 | + default-mysql-version: |
| 48 | + description: "Default version of MySQL to use" |
| 49 | + required: true |
| 50 | + type: string |
| 51 | + skip-providers-tests: |
| 52 | + description: "Skip provider tests (true/false)" |
| 53 | + required: true |
| 54 | + type: string |
| 55 | + run-coverage: |
| 56 | + description: "Run coverage (true/false)" |
| 57 | + required: true |
| 58 | + type: string |
| 59 | + default-python-version: |
| 60 | + description: "Which version of python should be used by default" |
| 61 | + required: true |
| 62 | + type: string |
| 63 | + debug-resources: |
| 64 | + description: "Debug resources (true/false)" |
| 65 | + required: true |
| 66 | + type: string |
| 67 | +jobs: |
| 68 | + tests-core-integration: |
| 69 | + timeout-minutes: 130 |
| 70 | + if: inputs.testable-core-integrations != '[]' |
| 71 | + name: "Integration core ${{ matrix.integration }}" |
| 72 | + runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }} |
| 73 | + strategy: |
| 74 | + fail-fast: false |
| 75 | + matrix: |
| 76 | + integration: ${{ fromJSON(inputs.testable-core-integrations) }} |
| 77 | + env: |
| 78 | + IMAGE_TAG: "${{ inputs.image-tag }}" |
| 79 | + BACKEND: "postgres" |
| 80 | + BACKEND_VERSION: ${{ inputs.default-postgres-version }}" |
| 81 | + PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}" |
| 82 | + JOB_ID: "integration-core-${{ matrix.integration }}" |
| 83 | + SKIP_PROVIDERS_TESTS: "${{ inputs.skip-providers-tests }}" |
| 84 | + ENABLE_COVERAGE: "${{ inputs.run-coverage}}" |
| 85 | + DEBUG_RESOURCES: "${{ inputs.debug-resources }}" |
| 86 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + GITHUB_USERNAME: ${{ github.actor }} |
| 89 | + VERBOSE: "true" |
| 90 | + steps: |
| 91 | + - name: "Cleanup repo" |
| 92 | + shell: bash |
| 93 | + run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*" |
| 94 | + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" |
| 95 | + uses: actions/checkout@v4 |
| 96 | + with: |
| 97 | + persist-credentials: false |
| 98 | + - name: "Cleanup docker" |
| 99 | + run: ./scripts/ci/cleanup_docker.sh |
| 100 | + - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" |
| 101 | + uses: ./.github/actions/prepare_breeze_and_image |
| 102 | + - name: "Integration: core ${{ matrix.integration }}" |
| 103 | + # yamllint disable rule:line-length |
| 104 | + run: ./scripts/ci/testing/run_integration_tests_with_retry.sh core "${{ matrix.integration }}" |
| 105 | + - name: "Post Tests success" |
| 106 | + uses: ./.github/actions/post_tests_success |
| 107 | + with: |
| 108 | + codecov-token: ${{ secrets.CODECOV_TOKEN }} |
| 109 | + python-version: ${{ inputs.default-python-version }} |
| 110 | + - name: "Post Tests failure" |
| 111 | + uses: ./.github/actions/post_tests_failure |
| 112 | + if: failure() |
| 113 | + |
| 114 | + tests-providers-integration: |
| 115 | + timeout-minutes: 130 |
| 116 | + if: inputs.testable-providers-integrations != '[]' && inputs.skip-providers-tests != 'true' |
| 117 | + name: "Integration: providers ${{ matrix.integration }}" |
| 118 | + runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }} |
| 119 | + strategy: |
| 120 | + fail-fast: false |
| 121 | + matrix: |
| 122 | + integration: ${{ fromJSON(inputs.testable-providers-integrations) }} |
| 123 | + env: |
| 124 | + IMAGE_TAG: "${{ inputs.image-tag }}" |
| 125 | + BACKEND: "postgres" |
| 126 | + BACKEND_VERSION: ${{ inputs.default-postgres-version }}" |
| 127 | + PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}" |
| 128 | + JOB_ID: "integration-providers-${{ matrix.integration }}" |
| 129 | + SKIP_PROVIDERS_TESTS: "${{ inputs.skip-providers-tests }}" |
| 130 | + ENABLE_COVERAGE: "${{ inputs.run-coverage}}" |
| 131 | + DEBUG_RESOURCES: "${{ inputs.debug-resources }}" |
| 132 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 133 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 134 | + GITHUB_USERNAME: ${{ github.actor }} |
| 135 | + VERBOSE: "true" |
| 136 | + steps: |
| 137 | + - name: "Cleanup repo" |
| 138 | + shell: bash |
| 139 | + run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*" |
| 140 | + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" |
| 141 | + uses: actions/checkout@v4 |
| 142 | + with: |
| 143 | + persist-credentials: false |
| 144 | + - name: "Cleanup docker" |
| 145 | + run: ./scripts/ci/cleanup_docker.sh |
| 146 | + - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" |
| 147 | + uses: ./.github/actions/prepare_breeze_and_image |
| 148 | + - name: "Integration: providers ${{ matrix.integration }}" |
| 149 | + run: ./scripts/ci/testing/run_integration_tests_with_retry.sh providers "${{ matrix.integration }}" |
| 150 | + - name: "Post Tests success" |
| 151 | + uses: ./.github/actions/post_tests_success |
| 152 | + with: |
| 153 | + codecov-token: ${{ secrets.CODECOV_TOKEN }} |
| 154 | + python-version: ${{ inputs.default-python-version }} |
| 155 | + - name: "Post Tests failure" |
| 156 | + uses: ./.github/actions/post_tests_failure |
| 157 | + if: failure() |
| 158 | + |
| 159 | + tests-system: |
| 160 | + timeout-minutes: 130 |
| 161 | + if: inputs.run-system-tests == 'true' |
| 162 | + name: "System Tests" |
| 163 | + runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }} |
| 164 | + env: |
| 165 | + IMAGE_TAG: "${{ inputs.image-tag }}" |
| 166 | + BACKEND: "postgres" |
| 167 | + BACKEND_VERSION: ${{ inputs.default-postgres-version }}" |
| 168 | + PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}" |
| 169 | + JOB_ID: "system" |
| 170 | + SKIP_PROVIDERS_TESTS: "${{ inputs.skip-providers-tests }}" |
| 171 | + ENABLE_COVERAGE: "${{ inputs.run-coverage}}" |
| 172 | + DEBUG_RESOURCES: "${{ inputs.debug-resources }}" |
| 173 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 174 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 175 | + GITHUB_USERNAME: ${{ github.actor }} |
| 176 | + VERBOSE: "true" |
| 177 | + steps: |
| 178 | + - name: "Cleanup repo" |
| 179 | + shell: bash |
| 180 | + run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*" |
| 181 | + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" |
| 182 | + uses: actions/checkout@v4 |
| 183 | + with: |
| 184 | + persist-credentials: false |
| 185 | + - name: "Cleanup docker" |
| 186 | + run: ./scripts/ci/cleanup_docker.sh |
| 187 | + - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" |
| 188 | + uses: ./.github/actions/prepare_breeze_and_image |
| 189 | + - name: "System Tests" |
| 190 | + run: > |
| 191 | + ./scripts/ci/testing/run_system_tests.sh |
| 192 | + tests/system/example_empty.py providers/tests/system/example_empty.py |
| 193 | + - name: "Post Tests success" |
| 194 | + uses: ./.github/actions/post_tests_success |
| 195 | + with: |
| 196 | + codecov-token: ${{ secrets.CODECOV_TOKEN }} |
| 197 | + python-version: ${{ inputs.default-python-version }} |
| 198 | + - name: "Post Tests failure" |
| 199 | + uses: ./.github/actions/post_tests_failure |
| 200 | + if: failure() |
0 commit comments