From 0d3c2f68df28985269f42ef702bb7751688dd8d6 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Thu, 2 Jan 2025 10:15:17 +0530 Subject: [PATCH 1/3] Test date --- .github/workflows/reusable-performance.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index e5c29aa0b1849..760fc2e3baff5 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -300,6 +300,8 @@ jobs: - name: Add workflow summary run: cat ${{ runner.temp }}/summary.md >> $GITHUB_STEP_SUMMARY + env: + COMMITTED_ATTT: $(git show -s $GITHUB_SHA --format="%cI") - name: Set the base sha # Only needed when publishing results. From 9550837edc1b507bcd41ec86b43e34ee437f3322 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Thu, 2 Jan 2025 11:43:28 +0530 Subject: [PATCH 2/3] Update reusable-performance.yml --- .github/workflows/reusable-performance.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index 760fc2e3baff5..59211b97fb4a9 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -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: @@ -298,10 +297,13 @@ 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 + env: + COMMITTED_AT_TEST: $(git show -s $GITHUB_SHA --format="%cI") + - name: Add workflow summary run: cat ${{ runner.temp }}/summary.md >> $GITHUB_STEP_SUMMARY - env: - COMMITTED_ATTT: $(git show -s $GITHUB_SHA --format="%cI") - name: Set the base sha # Only needed when publishing results. @@ -314,23 +316,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: | From b785c7b09cf0223a79e1ea1658c838658893aff5 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Thu, 2 Jan 2025 11:45:23 +0530 Subject: [PATCH 3/3] Update performance.yml --- .github/workflows/performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index dba6091a5547a..b9a78023ab9ef 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -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@mukeshpanchal27-patch-3 permissions: contents: read if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}