Skip to content

chore: update component test and generate reports #2

chore: update component test and generate reports

chore: update component test and generate reports #2

name: Component Test Reporter
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
test_and_upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1
- name: Setup Node
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Run Tests and Generate Report
run: |
npm run test:ts -- component
- name: Upload Report to S3
uses: jakejarvis/[email protected]
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SRC: ./test_reports/
DEST: /integrations-test-reports/${{ github.run_number }}/
- name: Comment on PR with S3 Object URL
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |

Check failure on line 47 in .github/workflows/component-test-report.yml

View workflow run for this annotation

GitHub Actions / Component Test Reporter

Invalid workflow file

The workflow is not valid. .github/workflows/component-test-report.yml (Line: 47, Col: 9): Unexpected value 'script'
const { owner, repo } = context.repo;
const runNumber = process.env.GITHUB_RUN_NUMBER;
const commentBody = `Test report for this run is available at: https://company.s3.amazonaws.com/integrations-test-reports/${runNumber}/test-report.html`;
// Get the pull request number
const prNumber = context.payload.pull_request.number;
// Comment on the pull request
await github.issues.createComment({ owner, repo, issue_number: prNumber, body: commentBody });