Skip to content

Commit

Permalink
feat: upload to s3
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-dixit committed Aug 19, 2024
1 parent 7e845dc commit 8ee962e
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/run_js_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,28 @@ jobs:
- name: run test
run: cd js && pnpm test:coverage

- name: Upload `coverage` folder
uses: actions/upload-artifact@v3
with:
name: coverage
path: js/coverage
retention-days: 1
- name: install aws cli
run: sudo apt-get install awscli

- name: Upload `coverage` folder to S3 and print unique URL
env:
AWS_ACCESS_KEY_ID: de51cf08ce14b98079755fdbc6e3048
AWS_SECRET_ACCESS_KEY: cb88d66644cbd83dbf0c1900aa592fd2264e8f1c73cebb1f538052286c784
AWS_S3_ENDPOINT: https://4d4f16c61d89ec64e760039c4ec50717.r2.cloudflarestorage.com
run: |
TIMESTAMP=$(date +%s)
UNIQUE_FOLDER="coverage-$TIMESTAMP"
aws s3 cp js/coverage "s3://$UNIQUE_FOLDER" --endpoint-url $AWS_S3_ENDPOINT --recursive
echo "Coverage folder unique URL: $AWS_S3_ENDPOINT/$UNIQUE_FOLDER"
- name: Upload jest html-reporters folder
uses: actions/upload-artifact@v3
with:
name: html-report
path: js/html-report
retention-days: 1
- name: Upload jest html-reporters folder to S3
env:
AWS_ACCESS_KEY_ID: de51cf08ce14b98079755fdbc6e3048
AWS_SECRET_ACCESS_KEY: cb88d66644cbd83dbf0c1900aa592fd2264e8f1c73cebb1f538052286c784
AWS_S3_ENDPOINT: https://4d4f16c61d89ec64e760039c4ec50717.r2.cloudflarestorage.com
run: |
TIMESTAMP=$(date +%s)
UNIQUE_FOLDER="html-report-$TIMESTAMP"
aws s3 cp js/html-report "s3://$UNIQUE_FOLDER" --endpoint-url $AWS_S3_ENDPOINT --recursive
echo "HTML report folder unique URL: $AWS_S3_ENDPOINT/$UNIQUE_FOLDER"

0 comments on commit 8ee962e

Please sign in to comment.