From 6e7d932294883164637774e87b8e379db225222c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 22 Mar 2026 21:13:47 +0000 Subject: [PATCH] Add CI-legacy-g2-genai reusable workflow (ubuntu24-tap-genai-gcov) --- .github/workflows/ci-legacy-g2-genai.yml | 130 +++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 .github/workflows/ci-legacy-g2-genai.yml diff --git a/.github/workflows/ci-legacy-g2-genai.yml b/.github/workflows/ci-legacy-g2-genai.yml new file mode 100644 index 000000000..d159ce91b --- /dev/null +++ b/.github/workflows/ci-legacy-g2-genai.yml @@ -0,0 +1,130 @@ +name: CI-legacy-g2-genai + +on: + workflow_dispatch: + workflow_call: + inputs: + trigger: + type: string + +env: + SHA: ${{ inputs.trigger && fromJson(inputs.trigger).event.workflow_run.head_sha || github.sha }} + +jobs: + tests: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + infradb: [ 'mysql57' ] + env: + BLDCACHE: ${{ inputs.trigger && fromJson(inputs.trigger).event.workflow_run.head_sha || github.sha }}_ubuntu24-tap-genai-gcov_src + MATRIX: '(${{ matrix.infradb }},genai-gcov)' + + steps: + + - uses: LouisBrunner/checks-action@v2.0.0 + id: checks + if: always() + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: '${{ github.workflow }} / ${{ github.job }} ${{ env.MATRIX }}' + repo: ${{ github.repository }} + sha: ${{ env.SHA }} + status: 'in_progress' + details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' + + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.repository }} + ref: ${{ env.SHA }} + path: 'proxysql' + sparse-checkout: | + test/infra + test/tap/groups + test/scripts + + - name: Cache restore src + id: cache-src + uses: actions/cache/restore@v4 + with: + key: ${{ env.BLDCACHE }} + fail-on-cache-miss: true + path: | + proxysql/src/ + + - name: Cache restore test + id: cache-test + uses: actions/cache/restore@v4 + with: + key: ${{ inputs.trigger && fromJson(inputs.trigger).event.workflow_run.head_sha || github.sha }}_ubuntu24-tap-genai-gcov_test + fail-on-cache-miss: true + path: | + proxysql/test/ + + - name: Verify binary + run: | + chmod +x proxysql/src/proxysql + file proxysql/src/proxysql + + - name: Build CI base image + run: | + cd proxysql/test/infra/docker-base + docker build -t proxysql-ci-base:latest . + + - name: Start infrastructure + run: | + cd proxysql + export INFRA_ID="ci-legacy-g2-genai" + export TAP_GROUP="legacy-g2" + export SKIP_CLUSTER_START=1 + test/infra/control/ensure-infras.bash + + - name: Run legacy-g2 tests (GenAI + Coverage) + run: | + cd proxysql + export INFRA_ID="ci-legacy-g2-genai" + export TAP_GROUP="legacy-g2" + export SKIP_CLUSTER_START=1 + export TAP_USE_NOISE=1 + export COVERAGE=1 + test/infra/control/run-tests-isolated.bash + + - name: Cleanup + if: always() + run: | + set +e + cd proxysql + export INFRA_ID="ci-legacy-g2-genai" + export TAP_GROUP="legacy-g2" + docker logs proxysql.ci-legacy-g2-genai 2>&1 | tail -50 || true + test/infra/control/stop-proxysql-isolated.bash + test/infra/control/destroy-infras.bash + + - name: Archive artifacts logs + if: ${{ failure() && !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ github.workflow }}-${{ env.SHA }}-logs-run#${{ github.run_number }} + path: | + proxysql/ci_*_logs/ + + - name: Archive coverage report + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ github.workflow }}-${{ env.SHA }}-coverage-run#${{ github.run_number }} + path: | + proxysql/ci_infra_logs/ci-legacy-g2-genai/coverage-report/ + if-no-files-found: ignore + + - uses: LouisBrunner/checks-action@v2.0.0 + if: always() + with: + token: ${{ secrets.GITHUB_TOKEN }} + check_id: ${{ steps.checks.outputs.check_id }} + repo: ${{ github.repository }} + sha: ${{ env.SHA }} + conclusion: ${{ job.status }} + details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'