-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upload test results s3 (#17720)
* chore: add job to upload logs to s3 bucket * chore: update file name * chore: include webapp in file name * chore: add test run date * chore: add timestamp to file name * chore: commit sha and date as a part of test job * chore: release tag upload tests to s3 * chore: publish job, upload tests to s3 * chore: env var for file name * chore: env var for file name
- Loading branch information
1 parent
ebb5c21
commit 38b8092
Showing
3 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,9 @@ jobs: | |
generate_test_report: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
UNIT_TEST_REPORT_FILE: './unit-tests.log' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -45,14 +48,20 @@ jobs: | |
- name: Test | ||
run: | | ||
set -o pipefail | ||
yarn test --coverage --coverage_reporters=lcov 2>&1 | tee ./unit-tests.log | ||
yarn test --coverage --coverage_reporters=lcov 2>&1 | tee ${{ env.UNIT_TEST_REPORT_FILE }} | ||
echo -e "COMMIT SHA = ${{ inputs.commit }}" >> ${{ env.UNIT_TEST_REPORT_FILE }} | ||
echo -e "TEST RUN DATE = $(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${{ env.UNIT_TEST_REPORT_FILE }} | ||
- name: Print environment variables | ||
- name: Install AWS CLI | ||
run: | | ||
echo -e "COMMIT SHA = ${{ inputs.commit }}" >> ./unit-tests.log | ||
sudo apt-get update | ||
sudo apt-get install -y awscli | ||
- name: Save test coverage results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage-report | ||
path: ./unit-tests.log | ||
- name: Upload unit-tests.log to S3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: eu-west-1 | ||
run: | | ||
TIMESTAMP=$(date -u +'%Y%m%dT%H%M%SZ') | ||
aws s3 cp ${{ env.UNIT_TEST_REPORT_FILE }} s3://wire-webapp/unit-tests-${TIMESTAMP}-${{ inputs.commit }}.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters