vitess.io/vitess@v0.16.2/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml (about) 1 # DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" 2 3 name: Cluster (onlineddl_vrepl) mysql57 4 on: [push, pull_request] 5 concurrency: 6 group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl) mysql57') 7 cancel-in-progress: true 8 9 env: 10 LAUNCHABLE_ORGANIZATION: "vitess" 11 LAUNCHABLE_WORKSPACE: "vitess-app" 12 GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}" 13 14 jobs: 15 build: 16 name: Run endtoend tests on Cluster (onlineddl_vrepl) mysql57 17 runs-on: ubuntu-22.04 18 19 steps: 20 - name: Skip CI 21 run: | 22 if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then 23 echo "skipping CI due to the 'Skip CI' label" 24 exit 1 25 fi 26 27 - name: Check if workflow needs to be skipped 28 id: skip-workflow 29 run: | 30 skip='false' 31 if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then 32 skip='true' 33 fi 34 echo Skip ${skip} 35 echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT 36 37 - name: Check out code 38 if: steps.skip-workflow.outputs.skip-workflow == 'false' 39 uses: actions/checkout@v3 40 41 - name: Check for changes in relevant files 42 if: steps.skip-workflow.outputs.skip-workflow == 'false' 43 uses: frouioui/paths-filter@main 44 id: changes 45 with: 46 token: '' 47 filters: | 48 end_to_end: 49 - 'go/**/*.go' 50 - 'test.go' 51 - 'Makefile' 52 - 'build.env' 53 - 'go.sum' 54 - 'go.mod' 55 - 'proto/*.proto' 56 - 'tools/**' 57 - 'config/**' 58 - 'bootstrap.sh' 59 - '.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml' 60 - 'go/test/endtoend/onlineddl/vrepl_suite/testdata' 61 62 - name: Set up Go 63 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 64 uses: actions/setup-go@v3 65 with: 66 go-version: 1.20.3 67 68 - name: Set up python 69 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 70 uses: actions/setup-python@v4 71 72 - name: Tune the OS 73 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 74 run: | 75 sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" 76 # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio 77 echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf 78 sudo sysctl -p /etc/sysctl.conf 79 80 - name: Get dependencies 81 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 82 run: | 83 sudo apt-get update 84 85 # Uninstall any previously installed MySQL first 86 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ 87 sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 88 89 sudo systemctl stop apparmor 90 sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common 91 sudo apt-get -y autoremove 92 sudo apt-get -y autoclean 93 sudo deluser mysql 94 sudo rm -rf /var/lib/mysql 95 sudo rm -rf /etc/mysql 96 97 # Get key to latest MySQL repo 98 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 99 100 wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb 101 # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 102 # packages for Jammy. 103 echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections 104 echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections 105 sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* 106 sudo apt-get update 107 sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 108 109 sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata 110 sudo service mysql stop 111 sudo service etcd stop 112 113 # install JUnit report formatter 114 go install github.com/vitessio/go-junit-report@HEAD 115 116 - name: Setup launchable dependencies 117 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' 118 run: | 119 # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up 120 pip3 install --user launchable~=1.0 > /dev/null 121 122 # verify that launchable setup is all correct. 123 launchable verify || true 124 125 # Tell Launchable about the build you are producing and testing 126 launchable record build --name "$GITHUB_RUN_ID" --source . 127 128 - name: Run cluster endtoend test 129 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 130 timeout-minutes: 45 131 run: | 132 # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file 133 # which musn't be more than 107 characters long. 134 export VTDATAROOT="/tmp/" 135 source build.env 136 137 set -x 138 139 # run the tests however you normally do, then produce a JUnit XML file 140 eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml 141 142 - name: Print test output and Record test result in launchable 143 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() 144 run: | 145 # send recorded tests to launchable 146 launchable record tests --build "$GITHUB_RUN_ID" go-test . || true 147 148 # print test output 149 cat output.txt