diff --git a/.github/workflows/slo.yml b/.github/workflows/slo.yml deleted file mode 100644 index 522c18cfc..000000000 --- a/.github/workflows/slo.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: SLO -on: - pull_request: - branches: - - master - - release-* - workflow_dispatch: -jobs: - test-slo: - concurrency: - group: slo-${{ github.ref }} - if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) - - runs-on: ubuntu-latest - name: SLO test - - permissions: - checks: write - issues: write - contents: read - pull-requests: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.23.x - cache: true - - - name: Build workload - run: | - cd ./tests/slo - go build -o .bin/native_query_linux_amd64 -ldflags "-X \"main.ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}\" -X \"main.label=native/query\" -X \"main.jobName=native-query\"" ./native/query - chmod +x .bin/native_query_linux_amd64 - - - name: Run SLO - uses: ydb-platform/slo-tests@v2 - continue-on-error: true - with: - GITHUB_TOKEN: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }} - WORKLOAD_RUNNER: "./tests/slo/.bin/native_query_linux_amd64 create grpc://localhost:2135 /Root/testdb && ./tests/slo/.bin/native_query_linux_amd64 run grpc://localhost:2135 /Root/testdb -prom-pgw localhost:9091 -report-period 500 -time 60 && ./tests/slo/.bin/native_query_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb" - CHAOS_TEST_RUNNER: "sleep 90" diff --git a/.github/workflows/slo_init.yml b/.github/workflows/slo_init.yml new file mode 100644 index 000000000..afe8ebb6f --- /dev/null +++ b/.github/workflows/slo_init.yml @@ -0,0 +1,72 @@ +name: ydb-slo-action-init + +on: + pull_request: + branches: + - master + - release-* + workflow_dispatch: + inputs: + github_pull_request_number: + required: true + +jobs: + ydb-slo-action-init: + concurrency: + group: slo-${{ github.ref }} + if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) + + name: YDB SLO Action Init + runs-on: ubuntu-latest + + strategy: + matrix: + sdk: + - id: database_sql + name: database-sql + path: ./database/sql + label: database/sql + - id: native_query + name: native-query + path: ./native/query + label: native/query + - id: native_table + name: native-table + path: ./native/table + label: native/table + - id: gorm + name: gorm + path: ./gorm + label: gorm + - id: xorm + name: xorm + path: ./xorm + label: xorm + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.23.x + cache: true + + - name: Build workload + run: | + cd ./tests/slo + go build -o .bin/${{matrix.sdk.id}}_linux_amd64 -ldflags "-X \"main.ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}\" -X \"main.label=${{matrix.sdk.label}}\" -X \"main.jobName=${{matrix.sdk.name}}\"" ${{matrix.sdk.path}} + chmod +x .bin/${{matrix.sdk.id}}_linux_amd64 + + - name: Inititialize YDB SLO + uses: ydb-platform/ydb-slo-action/init@main + with: + github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} + sdk_name: ${{ matrix.sdk.name }} + + - name: Run SLO Tests + run: | + ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 create grpc://localhost:2135 /Root/testdb + ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 run grpc://localhost:2135 /Root/testdb -prom-pgw localhost:9091 -report-period 500 -time 60 + ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb" diff --git a/.github/workflows/slo_report.yml b/.github/workflows/slo_report.yml new file mode 100644 index 000000000..6439eeb9d --- /dev/null +++ b/.github/workflows/slo_report.yml @@ -0,0 +1,22 @@ +name: ydb-slo-action-report + +on: + workflow_run: + workflows: ['ydb-slo-action-init'] + types: + - completed + +jobs: + test-ydb-slo-action: + runs-on: ubuntu-latest + name: YDB SLO Action Report + permissions: + contents: read + pull-requests: write + if: github.event.workflow_run.conclusion == 'success' + steps: + - name: Publish YDB SLO Report + uses: ydb-platform/ydb-slo-action/report@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + run_id: ${{ github.event.workflow_run.id }}