vitess.io/vitess@v0.16.2/.github/workflows/cluster_endtoend_backup_pitr_mysql57.yml (about) 1 # DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" 2 3 name: Cluster (backup_pitr) mysql57 4 on: [push, pull_request] 5 concurrency: 6 group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr) 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 (backup_pitr) 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_backup_pitr_mysql57.yml' 60 61 - name: Set up Go 62 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 63 uses: actions/setup-go@v3 64 with: 65 go-version: 1.20.3 66 67 - name: Set up python 68 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 69 uses: actions/setup-python@v4 70 71 - name: Tune the OS 72 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 73 run: | 74 sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" 75 # 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 76 echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf 77 sudo sysctl -p /etc/sysctl.conf 78 79 - name: Get dependencies 80 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 81 run: | 82 sudo apt-get update 83 84 # Uninstall any previously installed MySQL first 85 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ 86 sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 87 88 sudo systemctl stop apparmor 89 sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common 90 sudo apt-get -y autoremove 91 sudo apt-get -y autoclean 92 sudo deluser mysql 93 sudo rm -rf /var/lib/mysql 94 sudo rm -rf /etc/mysql 95 96 # Get key to latest MySQL repo 97 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 98 99 wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb 100 # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 101 # packages for Jammy. 102 echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections 103 echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections 104 sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* 105 sudo apt-get update 106 sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 107 108 sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata 109 sudo service mysql stop 110 sudo service etcd stop 111 112 # install JUnit report formatter 113 go install github.com/vitessio/go-junit-report@HEAD 114 115 - name: Setup launchable dependencies 116 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' 117 run: | 118 # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up 119 pip3 install --user launchable~=1.0 > /dev/null 120 121 # verify that launchable setup is all correct. 122 launchable verify || true 123 124 # Tell Launchable about the build you are producing and testing 125 launchable record build --name "$GITHUB_RUN_ID" --source . 126 127 - name: Run cluster endtoend test 128 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 129 timeout-minutes: 45 130 run: | 131 # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file 132 # which musn't be more than 107 characters long. 133 export VTDATAROOT="/tmp/" 134 source build.env 135 136 set -x 137 138 # run the tests however you normally do, then produce a JUnit XML file 139 eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml 140 141 - name: Print test output and Record test result in launchable 142 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() 143 run: | 144 # send recorded tests to launchable 145 launchable record tests --build "$GITHUB_RUN_ID" go-test . || true 146 147 # print test output 148 cat output.txt