Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix PR reporter #4531

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ jobs:
- uses: dorny/paths-filter@v3
id: filter
with:
# Should be kept in sync with the filter in the PR Reporter workflow
filters: |
jsChanged: '**/src/**.js'
jsChanged: '**/src/**/*.js'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we found in ad1fdf5


compressed_size:
name: Compressed Size
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/pr-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,37 @@ on:
# The pull_request event can't write comments for PRs from forks so using this
# workflow_run workflow as a workaround
workflow_run:
workflows: ['Benchmarks']
workflows: ['CI']
branches: ['**']
types:
- completed
- requested

jobs:
filter_jobs:
name: Filter jobs
runs-on: ubuntu-latest
outputs:
jsChanged: ${{ steps.filter.outputs.jsChanged }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
ref: ${{ github.event.workflow_run.head_branch }}
# Should be kept in sync with the filter in the CI workflow
filters: |
jsChanged: '**/src/**/*.js'

report_running:
name: Report benchmarks are in-progress
needs: filter_jobs
runs-on: ubuntu-latest
# Only add the "benchmarks are running" text when a workflow_run is
# requested (a.k.a starting)
if: ${{ github.event.action == 'requested' }}
if: |
needs.filter_jobs.outputs.jsChanged == 'true' &&
github.event.action == 'requested'
steps:
- name: Report Tachometer Running
uses: andrewiggins/tachometer-reporter-action@v2
Expand All @@ -27,10 +45,14 @@ jobs:

report_results:
name: Report benchmark results
needs: filter_jobs
runs-on: ubuntu-latest
# Only run this job if the event action was "completed" and the triggering
# workflow_run was successful
if: ${{ github.event.action == 'completed' && github.event.workflow_run.conclusion == 'success' }}
if: |
needs.filter_jobs.outputs.jsChanged == 'true' &&
github.event.action == 'completed' &&
github.event.workflow_run.conclusion == 'success'
steps:
# Download the artifact from the triggering workflow that contains the
# Tachometer results to report
Expand Down