Changeset 59749
- Timestamp:
- 02/01/2025 08:15:09 PM (5 months ago)
- Location:
- trunk/.github/workflows
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/performance.yml
r59725 r59749 34 34 - '.github/workflows/performance.yml' 35 35 - '.github/workflows/reusable-performance.yml' 36 - '.github/workflows/reusable-performance-*.yml' 36 37 workflow_dispatch: 37 38 … … 48 49 49 50 jobs: 51 determine-matrix: 52 name: Determine Matrix 53 runs-on: ubuntu-24.04 54 if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }} 55 permissions: {} 56 env: 57 TARGET_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} 58 outputs: 59 subjects: ${{ steps.set-subjects.outputs.result }} 60 target_sha: ${{ env.TARGET_SHA }} 61 steps: 62 # The `workflow_dispatch` event is the only one missing the needed SHA to target. 63 - name: Retrieve previous commit SHA (if necessary) 64 if: ${{ github.event_name == 'workflow_dispatch' }} 65 run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> "$GITHUB_ENV" 66 67 - name: Set subjects 68 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 69 id: set-subjects 70 with: 71 script: | 72 const artifacts = await github.rest.actions.listArtifactsForRepo({ 73 owner: context.repo.owner, 74 repo: context.repo.repo, 75 name: 'wordpress-build-' + process.env.TARGET_SHA, 76 }); 77 const has_previous_build = !! artifacts.data.artifacts[0]; 78 79 const subjects = [ 80 'current', 81 ]; 82 83 if ( context.eventName === 'push' && context.ref === 'refs/heads/trunk' ) { 84 subjects.push( 'base' ); 85 } else if ( has_previous_build ) { 86 subjects.push( 'before' ); 87 } 88 89 return subjects; 90 50 91 # Runs the performance test suite. 51 92 performance: 52 name: ${{ matrix.multisite && 'Multisite' || 'Single site' }} 53 uses: ./.github/workflows/reusable-performance.yml 93 name: ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} 94 uses: ./.github/workflows/reusable-performance-test-v2.yml 95 needs: [ determine-matrix ] 54 96 permissions: 55 97 contents: read 56 if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}57 98 strategy: 58 99 fail-fast: false … … 60 101 memcached: [ true, false ] 61 102 multisite: [ true, false ] 103 subject: ${{ fromJson( needs.determine-matrix.outputs.subjects ) }} 62 104 with: 63 105 memcached: ${{ matrix.memcached }} 64 106 multisite: ${{ matrix.multisite }} 107 subject: ${{ matrix.subject }} 108 TARGET_SHA: ${{ needs.determine-matrix.outputs.target_sha }} 109 110 compare: 111 name: ${{ matrix.label }} 112 uses: ./.github/workflows/reusable-performance-report-v2.yml 113 needs: [ determine-matrix, performance ] 114 permissions: 115 contents: read 116 strategy: 117 fail-fast: false 118 matrix: 119 memcached: [ true, false ] 120 multisite: [ true, false ] 121 label: [ Compare ] 122 with: 123 memcached: ${{ matrix.memcached }} 124 multisite: ${{ matrix.multisite }} 125 BASE_TAG: ${{ needs.performance.outputs.BASE_TAG }} 126 publish: ${{ contains( fromJson( needs.determine-matrix.outputs.subjects ), 'base' ) && ! matrix.memcached && ! matrix.multisite }} 65 127 secrets: 66 128 CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
Note: See TracChangeset
for help on using the changeset viewer.