diff --git a/.github/actions/e2e-report/action.yml b/.github/actions/e2e-report/action.yml deleted file mode 100644 index 9100c55acf2..00000000000 --- a/.github/actions/e2e-report/action.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: "E2E Report" -description: "Generate and upload E2E reports, and notify stakeholders" -inputs: - aws-s3-bucket: - description: "AWS S3 bucket name" - required: true - aws-role: - description: "AWS role to assume" - required: true - junit-pattern: - description: "Pattern to match JUnit reports" - default: "junit-report-*" - blob-pattern: - description: "Pattern to match blob reports" - default: "blob-report-*" - testrail-api-key: - description: "TestRail API Key" - required: true - github-token: - description: "GitHub token for API calls" - required: true - testrail-project: - description: "TestRail project name" - default: "Positron" - testrail-title: - description: "Title for TestRail runs" - default: "E2E Test Run" - -runs: - using: "composite" - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - name: Install AWS CLI - shell: bash - run: | - apt-get update && apt-get install -y unzip python3-pip - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip - unzip -q /tmp/awscliv2.zip -d /tmp - /tmp/aws/install -i $HOME/aws-cli -b $HOME/bin - rm -rf /tmp/aws /tmp/awscliv2.zip - - - name: Add AWS CLI to PATH - shell: bash - run: echo "$HOME/bin" >> $GITHUB_PATH - - - name: Verify AWS CLI installation - shell: bash - run: aws --version - - - name: Download Blob Reports - uses: actions/download-artifact@v4 - with: - path: all-blob-reports - pattern: ${{ inputs.blob-pattern }} - merge-multiple: true - - - name: Merge Blobs into HTML Report - shell: bash - run: npx playwright merge-reports --reporter html ./all-blob-reports - - - name: Upload Playwright Report to S3 - uses: ./.github/actions/upload-report-to-s3 - with: - role-to-assume: ${{ inputs.aws-role }} - - - name: Send HTML Report URL to GitHub Summary - shell: bash - run: | - REPORT_URL="https://d38p2avprg8il3.cloudfront.net/${{ env.REPORT_DIR }}/index.html" - echo "Report URL: $REPORT_URL" - echo "📄 [Playwright Report]($REPORT_URL)
" > $GITHUB_STEP_SUMMARY - - - name: Download JUnit Reports - uses: actions/download-artifact@v4 - with: - path: all-junit-reports - pattern: ${{ inputs.junit-pattern }} - merge-multiple: true - - - name: Merge JUnit Reports - shell: bash - run: npm install -g junit-report-merger && npx jrm junit.xml "all-junit-reports/*.xml" - - - name: Install trcli - shell: bash - run: apt-get update && apt-get install -y python3-pip && pip3 install trcli - - - name: Upload Test Results to TestRail - shell: bash - run: | - TESTRAIL_TITLE="$(date +'%Y-%m-%d') ${{ inputs.testrail-title }} - $GITHUB_REF_NAME" - echo "TESTRAIL_TITLE=$TESTRAIL_TITLE" >> $GITHUB_ENV - trcli --host "https://posit.testrail.io/" --project "${{ inputs.testrail-project }}" --username testrailautomation@posit.co --key "${{ inputs.testrail-api-key }}" parse_junit --file "./junit.xml" --case-matcher name --title "$TESTRAIL_TITLE" --close-run diff --git a/.github/actions/gen-report-dir/action.yml b/.github/actions/gen-report-dir/action.yml new file mode 100644 index 00000000000..d13157e20a3 --- /dev/null +++ b/.github/actions/gen-report-dir/action.yml @@ -0,0 +1,27 @@ +name: "Generate Report Directory & Send to GH Summary" +description: "Generates a unique REPORT_DIR and appends the report URL to the GitHub Step summary" +inputs: + bucket-url: + description: "Base URL of the S3 bucket or CDN for the report" + required: false + default: "https://d38p2avprg8il3.cloudfront.net" +runs: + using: "composite" + steps: + - name: Generate REPORT_DIR + shell: bash + run: | + # Generate a unique REPORT_DIR + RANDOM_SUFFIX=$RANDOM + REPORT_DIR="playwright-report-${{ github.run_id }}-${RANDOM_SUFFIX}" + + # Export REPORT_DIR for downstream steps + echo "REPORT_DIR=$REPORT_DIR" >> $GITHUB_ENV + echo "Generated REPORT_DIR: $REPORT_DIR" + + # Generate the REPORT_URL + REPORT_URL="${{ inputs.bucket-url }}/$REPORT_DIR/index.html" + echo "Report URL: $REPORT_URL" + + # Append REPORT_URL to the GitHub Step summary + echo "📄 [Playwright Report]($REPORT_URL)
" >> $GITHUB_STEP_SUMMARY diff --git a/.github/actions/upload-report-to-s3/action.yml b/.github/actions/upload-report-to-s3/action.yml index 0dec03de8bc..bc69ad75ed6 100644 --- a/.github/actions/upload-report-to-s3/action.yml +++ b/.github/actions/upload-report-to-s3/action.yml @@ -4,6 +4,9 @@ inputs: role-to-assume: description: "The AWS role to assume" required: true + report-dir: + description: "The path to the directory containing the Playwright report" + required: true runs: using: "composite" @@ -19,4 +22,4 @@ runs: if: ${{ !cancelled() }} shell: bash run: | - aws s3 cp playwright-report/. s3://positron-test-reports/playwright-report-${{ github.run_id }} --recursive + aws s3 cp playwright-report/. s3://positron-test-reports/${{ inputs.report-dir }} --recursive diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 93d6686c507..e96e4357dd3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,12 +10,16 @@ main branch by either pulling or rebasing. +### Tests to Run + +`@:critical` + ### QA Notes