|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ scylla-3.*x ] |
| 6 | + pull_request: |
| 7 | + branches: [ scylla-3.*x ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: Build |
| 13 | + runs-on: ubuntu-latest |
| 14 | + timeout-minutes: 10 |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + java-version: [8, 11] |
| 19 | + fail-fast: false |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout source |
| 23 | + uses: actions/checkout@v2 |
| 24 | + |
| 25 | + - name: Set up JDK ${{ matrix.java-version }} |
| 26 | + uses: actions/setup-java@v2 |
| 27 | + with: |
| 28 | + java-version: ${{ matrix.java-version }} |
| 29 | + distribution: 'adopt' |
| 30 | + |
| 31 | + - name: Compile source and tests |
| 32 | + run: mvn -B compile test-compile -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 33 | + |
| 34 | + verify: |
| 35 | + name: Full verify |
| 36 | + runs-on: ubuntu-latest |
| 37 | + timeout-minutes: 10 |
| 38 | + |
| 39 | + strategy: |
| 40 | + matrix: |
| 41 | + java-version: [8, 11] |
| 42 | + fail-fast: false |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Checkout source |
| 46 | + uses: actions/checkout@v2 |
| 47 | + |
| 48 | + - name: Set up JDK ${{ matrix.java-version }} |
| 49 | + uses: actions/setup-java@v2 |
| 50 | + with: |
| 51 | + java-version: ${{ matrix.java-version }} |
| 52 | + distribution: 'adopt' |
| 53 | + |
| 54 | + - name: Full verify |
| 55 | + run: mvn -B verify -DskipTests |
| 56 | + |
| 57 | + unit-tests: |
| 58 | + name: Unit tests |
| 59 | + runs-on: ubuntu-latest |
| 60 | + timeout-minutes: 10 |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout source |
| 64 | + uses: actions/checkout@v2 |
| 65 | + |
| 66 | + - name: Set up JDK 8 |
| 67 | + uses: actions/setup-java@v2 |
| 68 | + with: |
| 69 | + java-version: '8' |
| 70 | + distribution: 'adopt' |
| 71 | + |
| 72 | + - name: Run unit tests |
| 73 | + run: mvn -B test -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 74 | + |
| 75 | + - name: Copy test results |
| 76 | + if: success() || failure() |
| 77 | + run: | |
| 78 | + shopt -s globstar |
| 79 | + mkdir unit |
| 80 | + cp --parents ./**/target/*-reports/*.xml unit/ |
| 81 | +
|
| 82 | + - name: Upload test results |
| 83 | + uses: actions/upload-artifact@v2 |
| 84 | + if: success() || failure() |
| 85 | + with: |
| 86 | + name: test-results |
| 87 | + path: "*/**/target/*-reports/*.xml" |
| 88 | + |
| 89 | + setup-integration-tests: |
| 90 | + name: Setup ITs |
| 91 | + runs-on: ubuntu-latest |
| 92 | + timeout-minutes: 2 |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Checkout source |
| 96 | + uses: actions/checkout@v2 |
| 97 | + |
| 98 | + - name: Setup Python 3 |
| 99 | + uses: actions/setup-python@v2 |
| 100 | + with: |
| 101 | + python-version: '3.x' |
| 102 | + |
| 103 | + - name: Fetch Scylla and Cassandra versions |
| 104 | + id: fetch-versions |
| 105 | + run: | |
| 106 | + pip3 install -r ci/requirements.txt |
| 107 | + echo "::set-output name=scylla-integration-tests-versions::$(python3 ci/version_fetch.py scylla-oss-stable:2 scylla-oss-rc scylla-enterprise-stable:2 scylla-enterprise-rc)" |
| 108 | + echo "::set-output name=cassandra-integration-tests-versions::$(python3 ci/version_fetch.py cassandra3-stable:1)" |
| 109 | +
|
| 110 | + outputs: |
| 111 | + scylla-integration-tests-versions: ${{ steps.fetch-versions.outputs.scylla-integration-tests-versions }} |
| 112 | + cassandra-integration-tests-versions: ${{ steps.fetch-versions.outputs.cassandra-integration-tests-versions }} |
| 113 | + |
| 114 | + cassandra-integration-tests: |
| 115 | + name: Cassandra ITs |
| 116 | + runs-on: ubuntu-latest |
| 117 | + needs: [setup-integration-tests] |
| 118 | + timeout-minutes: 90 |
| 119 | + |
| 120 | + strategy: |
| 121 | + matrix: |
| 122 | + cassandra-version: ${{ fromJson(needs.setup-integration-tests.outputs.cassandra-integration-tests-versions) }} |
| 123 | + fail-fast: false |
| 124 | + |
| 125 | + steps: |
| 126 | + - name: Checkout source |
| 127 | + uses: actions/checkout@v2 |
| 128 | + |
| 129 | + - name: Set up JDK 8 |
| 130 | + uses: actions/setup-java@v2 |
| 131 | + with: |
| 132 | + java-version: '8' |
| 133 | + distribution: 'adopt' |
| 134 | + |
| 135 | + - name: Setup Python 3 |
| 136 | + uses: actions/setup-python@v2 |
| 137 | + with: |
| 138 | + python-version: '3.x' |
| 139 | + |
| 140 | + - name: Setup environment |
| 141 | + run: | |
| 142 | + pip3 install https://github.com/scylladb/scylla-ccm/archive/master.zip |
| 143 | +
|
| 144 | + - name: Run integration tests on Cassandra (${{ matrix.cassandra-version }}) |
| 145 | + run: mvn -B verify -Pshort -Dcassandra.version=${{ matrix.cassandra-version }} -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 146 | + |
| 147 | + - name: Copy test results |
| 148 | + if: success() || failure() |
| 149 | + run: | |
| 150 | + shopt -s globstar |
| 151 | + mkdir cassandra-${{ matrix.cassandra-version }} |
| 152 | + cp --parents ./**/target/*-reports/*.xml cassandra-${{ matrix.cassandra-version }}/ |
| 153 | +
|
| 154 | + - name: Upload test results |
| 155 | + uses: actions/upload-artifact@v2 |
| 156 | + if: success() || failure() |
| 157 | + with: |
| 158 | + name: test-results |
| 159 | + path: "*/**/target/*-reports/*.xml" |
| 160 | + |
| 161 | + - name: Upload CCM logs |
| 162 | + uses: actions/upload-artifact@v2 |
| 163 | + if: ${{ failure() }} |
| 164 | + with: |
| 165 | + name: ccm-logs-cassandra-${{ matrix.cassandra-version }} |
| 166 | + path: /tmp/*-0/ccm*/node*/logs/* |
| 167 | + |
| 168 | + scylla-integration-tests: |
| 169 | + name: Scylla ITs |
| 170 | + runs-on: ubuntu-latest |
| 171 | + needs: [setup-integration-tests] |
| 172 | + timeout-minutes: 90 |
| 173 | + |
| 174 | + strategy: |
| 175 | + matrix: |
| 176 | + scylla-version: ${{ fromJson(needs.setup-integration-tests.outputs.scylla-integration-tests-versions) }} |
| 177 | + fail-fast: false |
| 178 | + |
| 179 | + steps: |
| 180 | + - name: Checkout source |
| 181 | + uses: actions/checkout@v2 |
| 182 | + |
| 183 | + - name: Set up JDK 8 |
| 184 | + uses: actions/setup-java@v2 |
| 185 | + with: |
| 186 | + java-version: '8' |
| 187 | + distribution: 'adopt' |
| 188 | + |
| 189 | + - name: Setup Python 3 |
| 190 | + uses: actions/setup-python@v2 |
| 191 | + with: |
| 192 | + python-version: '3.x' |
| 193 | + |
| 194 | + - name: Setup environment |
| 195 | + run: | |
| 196 | + pip3 install https://github.com/avelanarius/scylla-ccm/archive/master.zip |
| 197 | + sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr" |
| 198 | +
|
| 199 | + - name: Run integration tests on Scylla (${{ matrix.scylla-version }}) |
| 200 | + run: mvn -B verify -Pshort -Dscylla.version=${{ matrix.scylla-version }} -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 201 | + |
| 202 | + - name: Copy test results |
| 203 | + if: success() || failure() |
| 204 | + run: | |
| 205 | + shopt -s globstar |
| 206 | + mkdir scylla-${{ matrix.scylla-version }} |
| 207 | + cp --parents ./**/target/*-reports/*.xml scylla-${{ matrix.scylla-version }}/ |
| 208 | +
|
| 209 | + - name: Upload test results |
| 210 | + uses: actions/upload-artifact@v2 |
| 211 | + if: success() || failure() |
| 212 | + with: |
| 213 | + name: test-results |
| 214 | + path: "*/**/target/*-reports/*.xml" |
| 215 | + |
| 216 | + - name: Upload CCM logs |
| 217 | + uses: actions/upload-artifact@v2 |
| 218 | + if: ${{ failure() }} |
| 219 | + with: |
| 220 | + name: ccm-logs-scylla-${{ matrix.scylla-version }} |
| 221 | + path: /tmp/*-0/ccm*/node*/logs/* |
0 commit comments