|
| 1 | +--- |
| 2 | +name: Molecule tests |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + pull_request: |
| 7 | + |
| 8 | +env: |
| 9 | + CARTRIDGE_CLI_VERSION: '2.4.0' |
| 10 | + |
| 11 | +jobs: |
| 12 | + molecule-tests-ce: |
| 13 | + if: | |
| 14 | + github.event_name == 'push' || |
| 15 | + github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'tarantool' |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + tarantool-version: ["1.10", "2.5"] |
| 20 | + fail-fast: false |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + path: '${{ github.repository }}' |
| 25 | + |
| 26 | + - name: Setup python |
| 27 | + uses: actions/setup-python@v2 |
| 28 | + with: |
| 29 | + python-version: '3.x' |
| 30 | + |
| 31 | + - name: Install molecule requirements |
| 32 | + run: | |
| 33 | + pip3 install --upgrade \ |
| 34 | + ansible==2.8 \ |
| 35 | + molecule==3.0.2 \ |
| 36 | + docker \ |
| 37 | + flake8==3.8.1 \ |
| 38 | + testinfra |
| 39 | +
|
| 40 | + - name: Cache test packages |
| 41 | + id: cache-packages |
| 42 | + uses: actions/cache@v2 |
| 43 | + with: |
| 44 | + path: '${{ github.repository }}/packages' |
| 45 | + key: ce-${{ matrix.tarantool-version }}-${{ env.CARTRIDGE_CLI_VERSION }} |
| 46 | + |
| 47 | + - name: Create test packages |
| 48 | + if: steps.cache-packages.outputs.cache-hit != 'true' |
| 49 | + working-directory: '${{ github.repository }}' |
| 50 | + run: | |
| 51 | + sudo apt -y update |
| 52 | + sudo apt -y install git gcc make cmake unzip |
| 53 | + git config --global user.email "[email protected]" \ |
| 54 | + && git config --global user.name "Tar Antool" |
| 55 | +
|
| 56 | + curl -L https://tarantool.io/release/${{ matrix.tarantool-version }}/installer.sh | bash |
| 57 | + sudo apt install -y cartridge-cli ${{ env.CARTRIDGE_CLI_VERSION }} |
| 58 | +
|
| 59 | + tarantool --version |
| 60 | + cartridge version |
| 61 | +
|
| 62 | + ./create-packages.sh |
| 63 | +
|
| 64 | + - name: Molecule tests |
| 65 | + working-directory: '${{ github.repository }}' |
| 66 | + run: molecule test |
| 67 | + |
| 68 | + molecule-tests-ee: |
| 69 | + if: github.event_name == 'push' |
| 70 | + runs-on: ubuntu-latest |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + sdk-version: ["2.6.1-0-gcfe0d1a55-r356"] |
| 74 | + fail-fast: false |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v2 |
| 77 | + with: |
| 78 | + path: '${{ github.repository }}' |
| 79 | + |
| 80 | + - name: Setup python |
| 81 | + uses: actions/setup-python@v2 |
| 82 | + with: |
| 83 | + python-version: '3.x' |
| 84 | + |
| 85 | + - name: Install molecule requirements |
| 86 | + run: | |
| 87 | + pip3 install --upgrade \ |
| 88 | + ansible==2.8 \ |
| 89 | + molecule==3.0.2 \ |
| 90 | + docker \ |
| 91 | + flake8==3.8.1 \ |
| 92 | + testinfra |
| 93 | +
|
| 94 | + - name: Cache test packages |
| 95 | + id: cache-packages |
| 96 | + uses: actions/cache@v2 |
| 97 | + with: |
| 98 | + path: '${{ github.repository }}/packages' |
| 99 | + key: sdk-${{ matrix.sdk-version }} |
| 100 | + |
| 101 | + - name: Create test packages |
| 102 | + if: steps.cache-packages.outputs.cache-hit != 'true' |
| 103 | + working-directory: '${{ github.repository }}' |
| 104 | + run: | |
| 105 | + sudo apt -y update |
| 106 | + sudo apt -y install git gcc make cmake unzip |
| 107 | + git config --global user.email "[email protected]" \ |
| 108 | + && git config --global user.name "Tar Antool" |
| 109 | +
|
| 110 | + ARCHIVE_NAME=tarantool-enterprise-bundle-${{ matrix.sdk-version }}.tar.gz |
| 111 | + curl -O -L \ |
| 112 | + https://tarantool:${{ secrets.SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/${ARCHIVE_NAME} |
| 113 | + tar -xzf ${ARCHIVE_NAME} |
| 114 | + rm -f ${ARCHIVE_NAME} |
| 115 | + source tarantool-enterprise/env.sh |
| 116 | +
|
| 117 | + tarantool --version |
| 118 | + cartridge version |
| 119 | +
|
| 120 | + ./create-packages.sh |
| 121 | +
|
| 122 | + - name: Molecule tests |
| 123 | + working-directory: '${{ github.repository }}' |
| 124 | + run: molecule test |
0 commit comments