From 82305a0c4f56c6c37ba0fe1c0a6c5a838ee6dbc1 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Wed, 2 Feb 2022 10:14:27 -0800 Subject: [PATCH] Use upload-artifact to upload logs on failure --- .github/workflows/benchmark.yml | 40 ++++++++++++++++++++++++++------- .github/workflows/ci.yml | 10 +++++++-- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 764265dc0..780e44dee 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -79,55 +79,79 @@ jobs: set -o pipefail rm -rf /tmp/mock xvfb-run --auto-servernum node Mock-Server/scripts/load-test.js \ - ./node_modules/.bin/electron . | tee benchmark-startup.log || \ - (cat /tmp/mock/logs/{app,main}.log && exit 1) + ./node_modules/.bin/electron . | tee benchmark-startup.log timeout-minutes: 10 env: NODE_ENV: production RUN_COUNT: 10 ELECTRON_ENABLE_STACK_DUMPING: on + - name: Upload startup benchmark logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: startup-logs + path: /tmp/mock/logs + - name: Run send benchmarks run: | set -o pipefail rm -rf /tmp/mock xvfb-run --auto-servernum node Mock-Server/scripts/send-test.js \ - ./node_modules/.bin/electron . | tee benchmark-send.log || \ - (cat /tmp/mock/logs/{app,main}.log && exit 1) + ./node_modules/.bin/electron . | tee benchmark-send.log timeout-minutes: 10 env: NODE_ENV: production RUN_COUNT: 100 ELECTRON_ENABLE_STACK_DUMPING: on + - name: Upload send benchmark logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: send-logs + path: /tmp/mock/logs + - name: Run group send benchmarks run: | set -o pipefail rm -rf /tmp/mock xvfb-run --auto-servernum node \ Mock-Server/scripts/group-send-test.js \ - ./node_modules/.bin/electron . | tee benchmark-group-send.log || \ - (cat /tmp/mock/logs/{app,main}.log && exit 1) + ./node_modules/.bin/electron . | tee benchmark-group-send.log timeout-minutes: 10 env: NODE_ENV: production RUN_COUNT: 100 ELECTRON_ENABLE_STACK_DUMPING: on + - name: Upload group send benchmark logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: group-send-logs + path: /tmp/mock/logs + - name: Run conversation open benchmarks run: | set -o pipefail rm -rf /tmp/mock xvfb-run --auto-servernum node \ Mock-Server/scripts/convo-open-test.js \ - ./node_modules/.bin/electron . | tee benchmark-convo-open.log || \ - (cat /tmp/mock/logs/{app,main}.log && exit 1) + ./node_modules/.bin/electron . | tee benchmark-convo-open.log timeout-minutes: 10 env: NODE_ENV: production RUN_COUNT: 100 ELECTRON_ENABLE_STACK_DUMPING: on + - name: Upload conversation open benchmark logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: convo-open-logs + path: /tmp/mock/logs + - name: Clone benchmark repo uses: actions/checkout@v2 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5033738dd..f15ccff97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -220,9 +220,15 @@ jobs: set -o pipefail rm -rf /tmp/mock xvfb-run --auto-servernum node Mock-Server/scripts/storage-service-test.js \ - ./node_modules/.bin/electron . || \ - (cat /tmp/mock/logs/{app,main}.log && exit 1) + ./node_modules/.bin/electron . timeout-minutes: 10 env: NODE_ENV: production DEBUG: mock:scripts:* + + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: logs + path: /tmp/mock/logs