vitess.io/vitess@v0.16.2/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml (about)

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