vitess.io/vitess@v0.16.2/.github/workflows/cluster_endtoend_22.yml (about) 1 # DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" 2 3 name: Cluster (22) 4 on: [push, pull_request] 5 concurrency: 6 group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (22)') 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 (22) 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_22.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 # Limit local port range to not use ports that overlap with server side 75 # ports that we listen on. 76 sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" 77 # 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 78 echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf 79 sudo sysctl -p /etc/sysctl.conf 80 81 - name: Get dependencies 82 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 83 run: | 84 85 # Get key to latest MySQL repo 86 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 87 # Setup MySQL 8.0 88 wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb 89 echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections 90 sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* 91 sudo apt-get update 92 # Install everything else we need, and configure 93 sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 94 95 sudo service mysql stop 96 sudo service etcd stop 97 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ 98 sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 99 go mod download 100 101 # install JUnit report formatter 102 go install github.com/vitessio/go-junit-report@HEAD 103 104 - name: Setup launchable dependencies 105 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' 106 run: | 107 # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up 108 pip3 install --user launchable~=1.0 > /dev/null 109 110 # verify that launchable setup is all correct. 111 launchable verify || true 112 113 # Tell Launchable about the build you are producing and testing 114 launchable record build --name "$GITHUB_RUN_ID" --source . 115 116 - name: Run cluster endtoend test 117 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 118 timeout-minutes: 45 119 run: | 120 # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file 121 # which musn't be more than 107 characters long. 122 export VTDATAROOT="/tmp/" 123 source build.env 124 125 set -x 126 127 # run the tests however you normally do, then produce a JUnit XML file 128 eatmydata -- go run test.go -docker=false -follow -shard 22 | tee -a output.txt | go-junit-report -set-exit-code > report.xml 129 130 - name: Print test output and Record test result in launchable 131 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() 132 run: | 133 # send recorded tests to launchable 134 launchable record tests --build "$GITHUB_RUN_ID" go-test . || true 135 136 # print test output 137 cat output.txt