Skip to content

Commit

Permalink
chore: save unit tests results to s3 bucket (#6357)
Browse files Browse the repository at this point in the history
* chore: save unit tests results to s3 bucket

* chore: copy-config skip lib check
  • Loading branch information
PatrykBuniX authored and V-Gira committed Aug 29, 2024
1 parent 2997514 commit d279165
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/generate_test_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -48,14 +51,20 @@ jobs:
- name: Test
run: |
set -o pipefail
yarn test:all --stream -- --verbose --coverage --coverage_reporters=lcov 2>&1 | tee ./unit-tests.log
yarn test:all --stream -- --verbose --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-web-packages-${TIMESTAMP}-${{ inputs.commit }}.log
3 changes: 2 additions & 1 deletion packages/copy-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"esModuleInterop": true,
"outDir": "lib"
"outDir": "lib",
"skipLibCheck": true
},
"exclude": ["node_modules", "src/test", "src/**/*.test.ts"],
"include": ["src"]
Expand Down

0 comments on commit d279165

Please sign in to comment.