Skip to content

Commit

Permalink
build(ci): performance.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Oct 13, 2024
1 parent 3512dbc commit 3eca7a3
Showing 1 changed file with 12 additions and 32 deletions.
44 changes: 12 additions & 32 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Performance Test
name: performance

on:
pull_request:
Expand All @@ -10,7 +10,7 @@ on:
- main

jobs:
build-react-day-picker:
build:
if: contains(github.event.pull_request.labels.*.name, 'performance')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -48,8 +48,9 @@ jobs:
name: rdp-dist
path: dist

run-performance-test:
needs: [build-react-day-picker]
run:
if: contains(github.event.pull_request.labels.*.name, 'performance')
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -112,7 +113,12 @@ jobs:
with:
name: markdown-report
path: ./performance-tests/reports/markdown-report.md


post-comment:
if: contains(github.event.pull_request.labels.*.name, 'performance')
needs: [run]
runs-on: ubuntu-latest
steps:
- name: Download markdown report
uses: actions/download-artifact@v4
with:
Expand All @@ -132,6 +138,7 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const { context, github } = require('@actions/github');
const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const markdownContent = process.env.markdown_content;
const comment = `Performance test reports are available [here](${artifactUrl}).\n\n### Markdown Report:\n\n${markdownContent}`;
Expand All @@ -140,30 +147,3 @@ jobs:
issue_number: context.issue.number,
body: comment
});
# - name: Post comment with download link and markdown content
# if: success()
# uses: actions/github-script@v7
# with:
# script: |
# const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
# const markdownContent = process.env.markdown;
# const comment = `Performance test reports are available [here](${artifactUrl}).\n\n### Markdown Report:\n\n${markdownContent}`;
# github.rest.issues.createComment({
# ...context.repo,
# issue_number: context.issue.number,
# body: comment
# });

# - name: Post comment with download link
# if: success()
# uses: actions/github-script@v7
# with:
# script: |
# const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
# const comment = `Performance test reports are available [here](${artifactUrl}).`;
# github.rest.issues.createComment({
# ...context.repo,
# issue_number: context.issue.number,
# body: comment
# });

0 comments on commit 3eca7a3

Please sign in to comment.