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

Performance tests: Fix date time log for commit #8072

Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# Runs the performance test suite.
performance:
name: Performance tests ${{ matrix.memcached && '(with memcached)' || '' }}
uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk
uses: mukeshpanchal27/wordpress-develop/.github/workflows/reusable-performance.yml@fix/performance-log-data-time
mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved
permissions:
contents: read
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ jobs:
# - Compare results.
# - Add workflow summary.
# - Set the base sha.
# - Set commit details.
# - Publish performance results.
# - Ensure version-controlled files are not modified or deleted.
performance:
Expand Down Expand Up @@ -298,6 +297,9 @@ jobs:
- name: Compare results
run: node ./tests/performance/compare-results.js ${{ runner.temp }}/summary.md

- name: Check date time
run: echo "COMMITTED_AT_TEST=$(git show -s $GITHUB_SHA --format='%cI')" >> $GITHUB_ENV
Copy link
Member Author

Choose a reason for hiding this comment

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

After 2b7099c we get the Date time.

See
Screenshot 2025-01-02 at 12 34 33 PM

mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved

- name: Add workflow summary
run: cat ${{ runner.temp }}/summary.md >> $GITHUB_STEP_SUMMARY

Expand All @@ -312,23 +314,12 @@ jobs:
const baseRef = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ env.BASE_TAG }}' });
return baseRef.data.object.sha;

- name: Set commit details
# Only needed when publishing results.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: commit-timestamp
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const commit_details = await github.rest.git.getCommit({ owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha });
return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))

- name: Publish performance results
# Only publish results on pushes to trunk.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
env:
BASE_SHA: ${{ steps.base-sha.outputs.result }}
COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
COMMITTED_AT: $(git show -s $GITHUB_SHA --format="%cI")
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
HOST_NAME: "www.codevitals.run"
run: |
Expand Down
Loading