| name: CI |
| |
| on: |
| push: |
| branches: [ master ] |
| pull_request: |
| branches: [ master ] |
| |
| jobs: |
| pull_request_test: |
| if: ${{ github.event.issue.pull_request }} |
| timeout-minutes: 180 |
| runs-on: ubuntu-20.04 |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up JDK 1.8 |
| uses: actions/setup-java@v1 |
| with: |
| java-version: 1.8 |
| java-package: jdk |
| architecture: x64 |
| - name: Cache local maven repository |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/ |
| !~/.m2/repository/org/apache/servicecomb |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2 |
| - name: Show the first log message |
| run: git log -n1 |
| - name: Build and Test and Install Docker |
| if: ${{ success() }} |
| run: ./mvnw clean install -B -Pdocker |
| - name: Upload unit test results when the previous step of a job fails |
| if: ${{ failure() }} |
| uses: actions/upload-artifact@v2 |
| with: |
| name: surefire-reports |
| path: ./**/target/surefire-reports/ |
| if-no-files-found: ignore |
| - name: Verify Demo |
| if: ${{ success() }} |
| run: ./mvnw clean verify -B -f demo -Pdemo -Pdocker -Ddocker.useColor=false -Ddocker.showLogs |
| - name: Verify Acceptance Tests |
| if: ${{ success() }} |
| run: ./mvnw clean verify -B -f acceptance-tests -Pdemo -Pdocker -Ddocker.useColor=false -Ddocker.showLogs |
| |
| push_master_test: |
| if: ${{ !github.event.issue.pull_request && github.event.repository.owner.login == 'apache' }} |
| timeout-minutes: 180 |
| runs-on: ubuntu-20.04 |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up JDK 1.8 |
| uses: actions/setup-java@v1 |
| with: |
| java-version: 1.8 |
| java-package: jdk |
| architecture: x64 |
| - name: Cache local maven repository |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/ |
| !~/.m2/repository/org/apache/servicecomb |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2 |
| - name: Show the first log message |
| run: git log -n1 |
| - name: Build and Test and Install Docker |
| if: ${{ success() }} |
| run: ./mvnw clean install -B -Pdocker |
| - name: Upload unit test results when the previous step of a job fails |
| if: ${{ failure() }} |
| uses: actions/upload-artifact@v2 |
| with: |
| name: surefire-reports |
| path: ./**/target/surefire-reports/ |
| if-no-files-found: ignore |
| - name: Verify Demo |
| if: ${{ success() }} |
| run: ./mvnw clean verify -B -f demo -Pdemo -Pdocker -Ddocker.useColor=false -Ddocker.showLogs |
| - name: Verify Acceptance Tests |
| if: ${{ success() }} |
| run: ./mvnw clean verify -B -f acceptance-tests -Pdemo -Pdocker -Ddocker.useColor=false -Ddocker.showLogs |