You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
proxysql/.github/workflows/ci-shuntest.yml

132 lines
4.3 KiB

name: CI-shuntest
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:
testdist: [ 'ubuntu22-tap' ]
# infradb: [ 'mysql57', 'mysql80', 'mysql81', 'mysql82', 'mariadb10', 'mariadb11' ]
infradb: [ 'mysql57' ]
env:
TESTDIST: ${{ matrix.testdist }}
INFRADB: ${{ matrix.infradb }}
BLDCACHE: ${{ inputs.trigger && fromJson(inputs.trigger).event.workflow_run.head_sha || github.sha }}_${{ matrix.testdist }}_src
MATRIX: '(${{ matrix.infradb }})'
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'
# action_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y sysbench gettext
- name: Wait for cache
env:
GH_TOKEN: ${{ secrets.gh_token }}
run: |
echo "BASELINE: '${BASELINE}'"
echo "Wating for cache '${BLDCACHE}' ..."
sleep $(( $RANDOM / 1024 ))
PROBE="$(gh cache list --limit 300 --repo ${{ github.repository }} | grep -i ${BLDCACHE} || echo '')"
while [[ -z ${PROBE} ]]; do
echo "Wating for cache '${BLDCACHE}' ..."
sleep 30
PROBE="$(gh cache list --limit 300 --repo ${{ github.repository }} | grep -i ${BLDCACHE} || echo '')"
done
echo "Cache available '${BLDCACHE}'"
- 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: Checkout jenkins_build_scripts
uses: actions/checkout@v4
with:
repository: 'proxysql/jenkins-build-scripts'
ref: 'proxysql_repl_tests'
fetch-depth: 0
path: 'jenkins-build-scripts'
token: ${{ secrets.GH_TOKEN }}
- name: Docker-hoster
run: |
cd jenkins-build-scripts/infra-docker-hoster
docker compose up -d
- name: Shun-tests
run: |
set +e
cd jenkins-build-scripts
grep -rl 'docker-compose ' | xargs -r -n1 sed -i 's/docker-compose /docker compose /g'
sed -i "s|#!/usr/bin/bash|#!/usr/bin/bash +e|" proxysql_repl_tests/bin/debezium-check.bash
sed -i "s|#!/usr/bin/bash|#!/usr/bin/bash +e|" proxysql_repl_tests/exec_repl_test.sh
sed -i "s|JENKINS_SCRIPTS_PATH=.*|JENKINS_SCRIPTS_PATH=${{ github.workspace }}/jenkins-build-scripts|" env.sh
sed -i "s|WORKSPACE=.*|WORKSPACE=${{ github.workspace }}/proxysql|" env.sh
cd proxysql_repl_tests
./exec_shun_test.sh
RC=$?
sudo chmod -R 777 ${{ github.workspace }}/*
exit $RC
- 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 artifacts bin
if: ${{ failure() && !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.workflow }}-${{ env.SHA }}-bin-run#${{ github.run_number }}
path: |
proxysql/binaries/
proxysql/src/
proxysql/libs/
# proxysql/deps/
- 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 }}
# action_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
details_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'