|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +# |
| 19 | + |
| 20 | +name: CI - Integration - Pulsar-IO Oracle Source |
| 21 | +on: |
| 22 | + pull_request: |
| 23 | + branches: |
| 24 | + - master |
| 25 | + push: |
| 26 | + branches: |
| 27 | + - branch-* |
| 28 | + |
| 29 | +env: |
| 30 | + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 |
| 31 | + |
| 32 | +jobs: |
| 33 | + |
| 34 | + pulsar-io: |
| 35 | + name: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + timeout-minutes: 120 |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: checkout |
| 41 | + uses: actions/checkout@v2 |
| 42 | + |
| 43 | + - name: Tune Runner VM |
| 44 | + uses: ./.github/actions/tune-runner-vm |
| 45 | + |
| 46 | + - name: Detect changed files |
| 47 | + id: changes |
| 48 | + uses: apache/pulsar-test-infra/paths-filter@master |
| 49 | + with: |
| 50 | + filters: .github/changes-filter.yaml |
| 51 | + |
| 52 | + - name: Check changed files |
| 53 | + id: check_changes |
| 54 | + run: echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}" |
| 55 | + |
| 56 | + - name: Cache local Maven repository |
| 57 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 58 | + uses: actions/cache@v2 |
| 59 | + with: |
| 60 | + path: | |
| 61 | + ~/.m2/repository/*/*/* |
| 62 | + !~/.m2/repository/org/apache/pulsar |
| 63 | + key: ${{ runner.os }}-m2-dependencies-all-${{ hashFiles('**/pom.xml') }} |
| 64 | + restore-keys: | |
| 65 | + ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| 66 | + ${{ runner.os }}-m2-dependencies-core-modules- |
| 67 | +
|
| 68 | + - name: Set up JDK 11 |
| 69 | + uses: actions/setup-java@v2 |
| 70 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 71 | + with: |
| 72 | + distribution: 'adopt' |
| 73 | + java-version: 11 |
| 74 | + |
| 75 | + - name: clean disk |
| 76 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 77 | + run: | |
| 78 | + sudo swapoff -a |
| 79 | + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc |
| 80 | + sudo apt clean |
| 81 | + docker rmi $(docker images -q) -f |
| 82 | + df -h |
| 83 | +
|
| 84 | + - name: run install by skip tests |
| 85 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 86 | + run: mvn -q -B -ntp clean install -DskipTests |
| 87 | + |
| 88 | + - name: build pulsar image |
| 89 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 90 | + run: mvn -B -f docker/pulsar/pom.xml install -am -Pdocker,-main -DskipTests -Ddocker.nocache=true |
| 91 | + |
| 92 | + - name: build pulsar-all image |
| 93 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 94 | + run: mvn -B -f docker/pulsar-all/pom.xml install -am -Pdocker,-main -DskipTests -Ddocker.nocache=true |
| 95 | + |
| 96 | + - name: build artifacts and docker image |
| 97 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 98 | + run: mvn -B -f tests/docker-images/pom.xml install -am -Pdocker,-main -DskipTests |
| 99 | + |
| 100 | + - name: run integration tests |
| 101 | + if: ${{ steps.check_changes.outputs.docs_only != 'true' }} |
| 102 | + run: ./build/run_integration_group.sh PULSAR_IO_ORA |
| 103 | + |
| 104 | + - name: Upload container logs |
| 105 | + uses: actions/upload-artifact@v2 |
| 106 | + if: ${{ cancelled() || failure() }} |
| 107 | + continue-on-error: true |
| 108 | + with: |
| 109 | + name: container-logs |
| 110 | + path: tests/integration/target/container-logs |
| 111 | + |
| 112 | + - name: Upload surefire-reports |
| 113 | + uses: actions/upload-artifact@v2 |
| 114 | + if: ${{ cancelled() || failure() }} |
| 115 | + continue-on-error: true |
| 116 | + with: |
| 117 | + name: surefire-reports |
| 118 | + path: tests/integration/target/surefire-reports |
0 commit comments