|
| 1 | +name: catch_flaky |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - 'test/*/*_test.lua' |
| 7 | + - 'test/*/*.test.lua' |
| 8 | + |
| 9 | +jobs: |
| 10 | + catch_flaky: |
| 11 | + if: github.event_name == 'pull_request' && |
| 12 | + !contains(github.event.pull_request.labels.*.name, 'noflaky') |
| 13 | + |
| 14 | + env: |
| 15 | + TNT_RELEASE_PATH: /home/runner/tnt-release |
| 16 | + |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + timeout-minutes: 180 |
| 19 | + steps: |
| 20 | + - name: Create variables for Tarantool |
| 21 | + run: | |
| 22 | + branch=master |
| 23 | + commit_hash=$(git ls-remote \ |
| 24 | + https://github.com/tarantool/tarantool.git \ |
| 25 | + --branch ${branch} | head -c 8) |
| 26 | + echo "TNT_BRANCH=${branch}" >> $GITHUB_ENV |
| 27 | + echo "VERSION_POSTFIX=-${commit_hash}" >> $GITHUB_ENV |
| 28 | + shell: bash |
| 29 | + |
| 30 | + - name: Cache tarantool build |
| 31 | + id: cache-tnt-release |
| 32 | + uses: actions/cache@v3 |
| 33 | + with: |
| 34 | + path: ${{ env.TNT_RELEASE_PATH }} |
| 35 | + key: cache-tnt-release-master${{ env.VERSION_POSTFIX }} |
| 36 | + |
| 37 | + - name: Clone tarantool |
| 38 | + if: steps.cache-tnt-release.outputs.cache-hit != 'true' |
| 39 | + uses: actions/checkout@v3 |
| 40 | + with: |
| 41 | + repository: tarantool/tarantool |
| 42 | + ref: ${{ env.TNT_BRANCH }} |
| 43 | + path: tarantool |
| 44 | + fetch-depth: 0 |
| 45 | + submodules: true |
| 46 | + |
| 47 | + - name: Build tarantool |
| 48 | + if: steps.cache-tnt-release.outputs.cache-hit != 'true' |
| 49 | + run: | |
| 50 | + sudo apt-get -y install build-essential cmake make zlib1g-dev \ |
| 51 | + libreadline-dev libncurses5-dev libssl-dev libunwind-dev \ |
| 52 | + libicu-dev python3 python3-yaml python3-six python3-gevent |
| 53 | + cd ${GITHUB_WORKSPACE}/tarantool |
| 54 | + mkdir build && cd build |
| 55 | + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DIST=ON |
| 56 | + make && make DESTDIR=${TNT_RELEASE_PATH} install |
| 57 | +
|
| 58 | + - name: Install tarantool |
| 59 | + # Workaround as actions/cache cannot restore data to /usr/local |
| 60 | + run: sudo cp -rvP ${TNT_RELEASE_PATH}/usr/local/* /usr/local/ |
| 61 | + |
| 62 | + - name: Clone the module |
| 63 | + uses: actions/checkout@v3 |
| 64 | + with: |
| 65 | + # Fetch the entire history for all branches and tags. It is needed for |
| 66 | + # upgrade testing. |
| 67 | + fetch-depth: 0 |
| 68 | + # Enable recursive submodules checkout as test-run git module is used |
| 69 | + # for running tests. |
| 70 | + submodules: recursive |
| 71 | + ref: ${{ github.event.pull_request.head.sha }} |
| 72 | + |
| 73 | + - name: Install test requirements |
| 74 | + run: pip3 install --user -r test-run/requirements.txt |
| 75 | + |
| 76 | + - name: Setup tt |
| 77 | + run: | |
| 78 | + curl -L https://tarantool.io/release/2/installer.sh | sudo bash |
| 79 | + sudo apt install -y tt |
| 80 | + tt version |
| 81 | +
|
| 82 | + - name: Setup luatest |
| 83 | + run: tt rocks install luatest |
| 84 | + |
| 85 | + - run: cmake . |
| 86 | + - run: make test-flaky |
| 87 | + env: |
| 88 | + RANGE: HEAD~${{ github.event.pull_request.commits }}..HEAD |
0 commit comments