|
| 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: "Python Integration" |
| 21 | + |
| 22 | +on: |
| 23 | + push: |
| 24 | + branches: |
| 25 | + - 'main' |
| 26 | + pull_request: |
| 27 | + paths: # Only run integration tests when Python (or the code they exercise) changes. |
| 28 | + - '**/*.py' |
| 29 | + - 'pyproject.toml' |
| 30 | + - 'uv.lock' |
| 31 | + - 'Makefile' |
| 32 | + - 'dev/**' # docker-compose files and fixtures used by the integration suites. |
| 33 | + - '.github/workflows/python-integration.yml' # this file itself. |
| 34 | + |
| 35 | +permissions: |
| 36 | + contents: read |
| 37 | + |
| 38 | +concurrency: |
| 39 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 40 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 41 | + |
| 42 | +jobs: |
| 43 | + integration-test: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 47 | + with: |
| 48 | + persist-credentials: false |
| 49 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 50 | + with: |
| 51 | + python-version: '3.12' |
| 52 | + - name: Install UV |
| 53 | + uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 |
| 54 | + with: |
| 55 | + enable-cache: true |
| 56 | + - name: Install system dependencies |
| 57 | + run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos |
| 58 | + - name: Install |
| 59 | + run: make install |
| 60 | + - name: Run integration tests with coverage |
| 61 | + run: COVERAGE=1 make test-integration |
| 62 | + - name: Show debug logs |
| 63 | + if: ${{ failure() }} |
| 64 | + run: docker compose -f dev/docker-compose-integration.yml logs |
| 65 | + - name: Upload coverage data |
| 66 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 67 | + with: |
| 68 | + name: coverage-integration |
| 69 | + path: .coverage* |
| 70 | + include-hidden-files: true |
| 71 | + |
| 72 | + integration-test-s3: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 76 | + with: |
| 77 | + persist-credentials: false |
| 78 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 79 | + with: |
| 80 | + python-version: '3.12' |
| 81 | + - name: Install UV |
| 82 | + uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 |
| 83 | + with: |
| 84 | + enable-cache: true |
| 85 | + - name: Install system dependencies |
| 86 | + run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos |
| 87 | + - name: Install |
| 88 | + run: make install |
| 89 | + - name: Run s3 integration tests with coverage |
| 90 | + run: COVERAGE=1 make test-s3 |
| 91 | + - name: Show debug logs |
| 92 | + if: ${{ failure() }} |
| 93 | + run: docker compose -f dev/docker-compose.yml logs |
| 94 | + - name: Upload coverage data |
| 95 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 96 | + with: |
| 97 | + name: coverage-s3 |
| 98 | + path: .coverage* |
| 99 | + include-hidden-files: true |
| 100 | + |
| 101 | + integration-test-adls: |
| 102 | + runs-on: ubuntu-latest |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 105 | + with: |
| 106 | + persist-credentials: false |
| 107 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 108 | + with: |
| 109 | + python-version: '3.12' |
| 110 | + - name: Install UV |
| 111 | + uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 |
| 112 | + with: |
| 113 | + enable-cache: true |
| 114 | + - name: Install system dependencies |
| 115 | + run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos |
| 116 | + - name: Install |
| 117 | + run: make install |
| 118 | + - name: Run adls integration tests with coverage |
| 119 | + run: COVERAGE=1 make test-adls |
| 120 | + - name: Show debug logs |
| 121 | + if: ${{ failure() }} |
| 122 | + run: docker compose -f dev/docker-compose-azurite.yml logs |
| 123 | + - name: Upload coverage data |
| 124 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 125 | + with: |
| 126 | + name: coverage-adls |
| 127 | + path: .coverage* |
| 128 | + include-hidden-files: true |
| 129 | + |
| 130 | + integration-test-gcs: |
| 131 | + runs-on: ubuntu-latest |
| 132 | + steps: |
| 133 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 134 | + with: |
| 135 | + persist-credentials: false |
| 136 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 137 | + with: |
| 138 | + python-version: '3.12' |
| 139 | + - name: Install UV |
| 140 | + uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 |
| 141 | + with: |
| 142 | + enable-cache: true |
| 143 | + - name: Install system dependencies |
| 144 | + run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos |
| 145 | + - name: Install |
| 146 | + run: make install |
| 147 | + - name: Run gcs integration tests with coverage |
| 148 | + run: COVERAGE=1 make test-gcs |
| 149 | + - name: Show debug logs |
| 150 | + if: ${{ failure() }} |
| 151 | + run: docker compose -f dev/docker-compose-gcs-server.yml logs |
| 152 | + - name: Upload coverage data |
| 153 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 154 | + with: |
| 155 | + name: coverage-gcs |
| 156 | + path: .coverage* |
| 157 | + include-hidden-files: true |
| 158 | + |
| 159 | + integration-coverage-report: |
| 160 | + runs-on: ubuntu-latest |
| 161 | + needs: [integration-test, integration-test-s3, integration-test-adls, integration-test-gcs] |
| 162 | + steps: |
| 163 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 164 | + with: |
| 165 | + persist-credentials: false |
| 166 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 167 | + with: |
| 168 | + python-version: '3.12' |
| 169 | + - name: Install UV |
| 170 | + uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 |
| 171 | + with: |
| 172 | + enable-cache: true |
| 173 | + - name: Install dependencies |
| 174 | + run: uv sync --group dev |
| 175 | + - name: Download all coverage artifacts |
| 176 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 177 | + with: |
| 178 | + pattern: coverage-* |
| 179 | + merge-multiple: true |
| 180 | + - name: Generate coverage report (75%) # Coverage threshold should only increase over time — never decrease it! |
| 181 | + run: COVERAGE_FAIL_UNDER=75 make coverage-report |
0 commit comments