|
| 1 | +name: Daily Integration Tests |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * *' |
| 6 | + workflow_dispatch: |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + paths: |
| 11 | + - '.github/workflows/cron.integration.yml' |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + version: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + outputs: |
| 21 | + version: ${{ steps.version.outputs.version }} |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - name: Check New Version |
| 25 | + id: version |
| 26 | + env: |
| 27 | + GH_TOKEN: ${{ github.token }} |
| 28 | + run: | |
| 29 | + version=$(gh api repos/databendlabs/databend/releases --jq '.[0].tag_name') |
| 30 | + echo "version=$version" >> $GITHUB_OUTPUT |
| 31 | + echo "Running integration tests with Databend version: **$version**" >> $GITHUB_STEP_SUMMARY |
| 32 | +
|
| 33 | + integration: |
| 34 | + needs: version |
| 35 | + runs-on: [self-hosted, Linux, X64, 2c8g, aws] |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - uses: ./.github/actions/setup |
| 39 | + with: |
| 40 | + runner: aws |
| 41 | + cache-key: integration |
| 42 | + - name: Get License from S3 |
| 43 | + run: | |
| 44 | + aws s3 cp s3://databend-ci/misc/license-trial.key license.key |
| 45 | + aws s3 cp s3://databend-ci/misc/license-trial.json license.json |
| 46 | + cat license.json |
| 47 | + echo "QUERY_DATABEND_ENTERPRISE_LICENSE=$(cat license.key)" >> $GITHUB_ENV |
| 48 | + - name: Run Core Integration Tests |
| 49 | + run: make -C tests test-core DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }} |
| 50 | + - name: Run Driver Integration Tests |
| 51 | + run: make -C tests test-driver DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }} |
| 52 | + - name: Run BendSQL Integration Tests |
| 53 | + run: make -C tests test-bendsql DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }} |
| 54 | + |
| 55 | + build-python: |
| 56 | + name: build-python |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + - name: Setup Rust toolchain |
| 61 | + uses: ./.github/actions/setup |
| 62 | + with: |
| 63 | + cache-key: bindings-python-linux-x64 |
| 64 | + target: x86_64-unknown-linux-gnu |
| 65 | + - name: Build wheels |
| 66 | + uses: PyO3/maturin-action@v1 |
| 67 | + with: |
| 68 | + working-directory: bindings/python |
| 69 | + target: x86_64-unknown-linux-gnu |
| 70 | + manylinux: auto |
| 71 | + sccache: "true" |
| 72 | + args: --release --strip --out dist |
| 73 | + - name: Upload artifact |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: bindings-python |
| 77 | + path: bindings/python/dist/*.whl |
| 78 | + |
| 79 | + build-nodejs: |
| 80 | + name: build-nodejs |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + - name: Setup Rust toolchain |
| 85 | + uses: ./.github/actions/setup |
| 86 | + with: |
| 87 | + cache-key: bindings-nodejs-linux-x64 |
| 88 | + target: x86_64-unknown-linux-gnu |
| 89 | + - name: Setup node |
| 90 | + uses: actions/setup-node@v4 |
| 91 | + with: |
| 92 | + node-version: "22" |
| 93 | + - name: Corepack |
| 94 | + working-directory: bindings/nodejs |
| 95 | + run: npm i -g --force corepack && corepack enable |
| 96 | + - name: Install dependencies |
| 97 | + working-directory: bindings/nodejs |
| 98 | + run: pnpm install |
| 99 | + - name: Build |
| 100 | + working-directory: bindings/nodejs |
| 101 | + shell: bash |
| 102 | + env: |
| 103 | + NAPI_TARGET: x86_64-unknown-linux-gnu |
| 104 | + run: | |
| 105 | + pnpm napi build --platform --target=$NAPI_TARGET --release --js generated.js |
| 106 | + pnpm node ./scripts/header.js |
| 107 | + - uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: bindings-nodejs |
| 110 | + path: bindings/nodejs/*.node |
| 111 | + |
| 112 | + integration-python: |
| 113 | + needs: [version, build-python] |
| 114 | + runs-on: ubuntu-latest |
| 115 | + strategy: |
| 116 | + matrix: |
| 117 | + pyver: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] |
| 118 | + steps: |
| 119 | + - uses: actions/checkout@v4 |
| 120 | + - name: Setup Python |
| 121 | + uses: actions/setup-python@v5 |
| 122 | + with: |
| 123 | + python-version: ${{ matrix.pyver }} |
| 124 | + - name: Prepare |
| 125 | + working-directory: tests |
| 126 | + run: make up DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }} |
| 127 | + - name: Download artifact |
| 128 | + uses: actions/download-artifact@v4 |
| 129 | + with: |
| 130 | + name: bindings-python |
| 131 | + path: bindings/python/artifacts |
| 132 | + - name: Install dependencies |
| 133 | + working-directory: bindings/python |
| 134 | + run: | |
| 135 | + pip install behave |
| 136 | + pip install artifacts/*.whl |
| 137 | + - name: Test AsyncIO |
| 138 | + working-directory: bindings/python |
| 139 | + run: behave tests/asyncio |
| 140 | + - name: Test Blocking |
| 141 | + working-directory: bindings/python |
| 142 | + run: behave tests/blocking |
| 143 | + - name: Test Cursor |
| 144 | + working-directory: bindings/python |
| 145 | + run: behave tests/cursor |
| 146 | + |
| 147 | + integration-nodejs: |
| 148 | + needs: [version, build-nodejs] |
| 149 | + runs-on: ubuntu-latest |
| 150 | + strategy: |
| 151 | + matrix: |
| 152 | + ver: ["18", "20", "22"] |
| 153 | + steps: |
| 154 | + - uses: actions/checkout@v4 |
| 155 | + - name: Setup node |
| 156 | + uses: actions/setup-node@v4 |
| 157 | + with: |
| 158 | + node-version: ${{ matrix.ver }} |
| 159 | + - name: Corepack |
| 160 | + working-directory: bindings/nodejs |
| 161 | + run: npm i -g --force corepack && corepack enable |
| 162 | + - name: Install dependencies |
| 163 | + working-directory: bindings/nodejs |
| 164 | + run: pnpm install |
| 165 | + - name: Prepare |
| 166 | + working-directory: tests |
| 167 | + run: make up DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }} |
| 168 | + - name: Download artifact |
| 169 | + uses: actions/download-artifact@v4 |
| 170 | + with: |
| 171 | + name: bindings-nodejs |
| 172 | + path: bindings/nodejs |
| 173 | + - name: Run Tests |
| 174 | + working-directory: bindings/nodejs |
| 175 | + run: pnpm run test |
| 176 | + |
| 177 | + |
| 178 | + notify: |
| 179 | + if: failure() |
| 180 | + needs: [integration, integration-python, integration-nodejs] |
| 181 | + runs-on: ubuntu-latest |
| 182 | + steps: |
| 183 | + - uses: actions/checkout@v4 |
| 184 | + - name: Notify Dev Team |
| 185 | + uses: actions/github-script@v7 |
| 186 | + env: |
| 187 | + WEBHOOK_URL: ${{ secrets.DEV_TEAM_WEBHOOK_URL }} |
| 188 | + with: |
| 189 | + script: | |
| 190 | + const body = { |
| 191 | + msg_type: 'text', |
| 192 | + content: { |
| 193 | + text: '⚠️ BendSQL Integration Tests Failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}', |
| 194 | + } |
| 195 | + } |
| 196 | + const response = await fetch(process.env.WEBHOOK_URL, { |
| 197 | + method: 'POST', |
| 198 | + body: JSON.stringify(body), |
| 199 | + headers: {'Content-Type': 'application/json'} |
| 200 | + }); |
| 201 | + const result = await response.json(); |
| 202 | + console.log(result); |
0 commit comments