Skip to content

Commit

Permalink
fixup! [forge] check for necessary images only
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun committed Nov 1, 2024
1 parent 07e2190 commit 3e39b62
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/forge-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 3e39b62

Please sign in to comment.