[SCB-2649] Upload integration-tests logs when failure (#3241)
diff --git a/.github/actions/copy-integration-tests-logs/action.yml b/.github/actions/copy-integration-tests-logs/action.yml
new file mode 100644
index 0000000..e25d3f8
--- /dev/null
+++ b/.github/actions/copy-integration-tests-logs/action.yml
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Copy test reports
+description: Aggregates all integration-tests logs
+runs:
+ using: composite
+ steps:
+ - run: bash $GITHUB_WORKSPACE/ci/copy-integration-tests-logs.sh
+ shell: bash
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index d76747f..81aba8e 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -48,3 +48,14 @@
run: mvn clean install -Dcheckstyle.skip -Dspotbugs.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B -Pdocker -Pdemo-run-release -Pjacoco -Pit -Pcoverage
- name: publish coverage report
run: bash <(curl -s https://codecov.io/bash)
+ - name: Collect integration-tests logs
+ if: failure()
+ continue-on-error: true
+ uses: ./.github/actions/copy-integration-tests-logs
+ - name: Upload Surefire reports
+ uses: actions/upload-artifact@v3
+ if: failure()
+ continue-on-error: true
+ with:
+ name: integration-tests-logs
+ path: integration-tests-logs
diff --git a/.github/workflows/unit-test-jdk11.yml b/.github/workflows/unit-test-jdk11.yml
index ae53b7d..2f7b6c6 100644
--- a/.github/workflows/unit-test-jdk11.yml
+++ b/.github/workflows/unit-test-jdk11.yml
@@ -25,7 +25,7 @@
- master
jobs:
- build:
+ unit-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/unit-test-jdk17.yml b/.github/workflows/unit-test-jdk17.yml
index b0a49bb..3a5160c 100644
--- a/.github/workflows/unit-test-jdk17.yml
+++ b/.github/workflows/unit-test-jdk17.yml
@@ -25,7 +25,7 @@
- master
jobs:
- build:
+ unit-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
@@ -37,3 +37,14 @@
distribution: 'temurin'
- name: Compilation and Installation
run: mvn -B -Dcheckstyle.skip -Dspotbugs.skip=true clean install -Pit
+ - name: Collect integration-tests logs
+ if: failure()
+ continue-on-error: true
+ uses: ./.github/actions/copy-integration-tests-logs
+ - name: Upload Surefire reports
+ uses: actions/upload-artifact@v3
+ if: failure()
+ continue-on-error: true
+ with:
+ name: integration-tests-logs
+ path: integration-tests-logs
diff --git a/ci/copy-integration-tests-logs.sh b/ci/copy-integration-tests-logs.sh
new file mode 100644
index 0000000..67c792e
--- /dev/null
+++ b/ci/copy-integration-tests-logs.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+mkdir integration-tests-logs
+cp ./integration-tests/it-consumer/servicecomb-integration-*.log integration-tests-logs/