From 3e39b6233c9bb188c555260624f0fafb391a4b9f Mon Sep 17 00:00:00 2001 From: Balaji Arun Date: Fri, 1 Nov 2024 14:40:25 -0700 Subject: [PATCH] fixup! [forge] check for necessary images only --- .github/workflows/forge-stable.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/forge-stable.yaml b/.github/workflows/forge-stable.yaml index a677c21f04ad2a..724bfd5a82b326 100644 --- a/.github/workflows/forge-stable.yaml +++ b/.github/workflows/forge-stable.yaml @@ -73,9 +73,8 @@ jobs: generate-matrix: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.set-matrix.outputs.result }} - needsFailpoints: ${{ steps.set-matrix.outputs.needsFailpoints }} - needsPerformance: ${{ steps.set-matrix.outputs.needsPerformance }} + matrix: ${{ steps.set-matrix.outputs.matrix }} + imageVariants: ${{ steps.set-matrix.outputs.imageVariants }} steps: - name: Compute matrix id: set-matrix @@ -111,7 +110,7 @@ jobs: core.summary.addHeading('Forge Stable Run'); - const testsToRunNames = matrix.map(test => `${test.TEST_NAME} (Needs Failpoint: ${test.FORGE_ENABLE_FAILPOINTS}, Needs Performance: ${test.FORGE_ENABLE_PERFORMANCE})`); + const testsToRunNames = matrix.map(test => `${test.TEST_NAME} (Needs Failpoint: ${test.FORGE_ENABLE_FAILPOINTS || false}, Needs Performance: ${test.FORGE_ENABLE_PERFORMANCE || false})`); core.summary.addRaw("The following tests will be run:", true); core.summary.addList(testsToRunNames); @@ -120,7 +119,16 @@ jobs: const needsFailpoints = matrix.some(test => test.FORGE_ENABLE_FAILPOINTS); const needsPerformance = matrix.some(test => test.FORGE_ENABLE_PERFORMANCE); - return { matrix: JSON.stringify({ include: matrix }), needsFailpoints, needsPerformance }; + let requiredImageVariants = []; + if (needsFailpoints) { + requiredImageVariants.push('failpoints'); + } + if (needsPerformance) { + requiredImageVariants.push('performance'); + } + + core.setOutput('matrix', JSON.stringify({ include: matrix })); + core.setOutput('imageVariants', requiredImageVariants.join(' ')); # This job determines the image tag and branch to test, and passes them to the other jobs # NOTE: this may be better as a separate workflow as the logic is quite complex but generalizable @@ -184,13 +192,13 @@ jobs: id: get-docker-image-tag with: branch: ${{ steps.determine-test-branch.outputs.BRANCH }} - variants: ${{ format('{0} {1}', needs.generate-matrix.outputs.needsFailpoints && 'failpoints' || '', needs.generate-matrix.outputs.needsPerformance && 'performance' || '') }} + variants: ${{ needs.generate-matrix.outputs.imageVariants }} - uses: aptos-labs/aptos-core/.github/actions/determine-or-use-target-branch-and-get-last-released-image@main id: get-last-released-image-tag-for-compat-test with: base-branch: ${{ steps.determine-test-branch.outputs.BRANCH }} - variants: ${{ format('{0} {1}', needs.generate-matrix.outputs.needsFailpoints && 'failpoints' || '', needs.generate-matrix.outputs.needsPerformance && 'performance' || '') }} + variants: ${{ needs.generate-matrix.outputs.imageVariants }} - name: Write summary run: |