From 83eb829a2ecf47c285f2746e9b869739f8fe715a Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Fri, 21 Apr 2023 10:22:00 +0200 Subject: [PATCH] feat(repo): ignore macos timings for nightly duration report --- .github/workflows/e2e-matrix.yml | 47 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/e2e-matrix.yml b/.github/workflows/e2e-matrix.yml index bbcf3e9adbcfa..74e2e6766b8e4 100644 --- a/.github/workflows/e2e-matrix.yml +++ b/.github/workflows/e2e-matrix.yml @@ -525,30 +525,33 @@ jobs: yarn: 0, pnpm: 0 }; + const macosProjects = ['e2e-detox', 'e2e-expo', 'e2e-react-native']; combined.forEach((matrix) => { if (matrix.os_name === 'Linux' && matrix.node_version === 18) { pmReport[matrix.package_manager] += matrix.duration; } - if (timeReport[matrix.project]) { - if (matrix.duration > timeReport[matrix.project].max) { - timeReport[matrix.project].max = matrix.duration; - timeReport[ - matrix.project - ].maxEnv = `${matrix.os_name}, ${matrix.package_manager}`; + if (matrix.os_name === 'Linux' || macosProjects.includes(matrix.project)) { + if (timeReport[matrix.project]) { + if (matrix.duration > timeReport[matrix.project].max) { + timeReport[matrix.project].max = matrix.duration; + timeReport[ + matrix.project + ].maxEnv = `${matrix.os_name}, ${matrix.package_manager}`; + } + if (matrix.duration < timeReport[matrix.project].min) { + timeReport[matrix.project].min = matrix.duration; + timeReport[ + matrix.project + ].minEnv = `${matrix.os_name}, ${matrix.package_manager}`; + } + } else { + timeReport[matrix.project] = { + min: matrix.duration, + max: matrix.duration, + minEnv: `${matrix.os_name}, ${matrix.package_manager}`, + maxEnv: `${matrix.os_name}, ${matrix.package_manager}`, + }; } - if (matrix.duration < timeReport[matrix.project].min) { - timeReport[matrix.project].min = matrix.duration; - timeReport[ - matrix.project - ].minEnv = `${matrix.os_name}, ${matrix.package_manager}`; - } - } else { - timeReport[matrix.project] = { - min: matrix.duration, - max: matrix.duration, - minEnv: `${matrix.os_name}, ${matrix.package_manager}`, - maxEnv: `${matrix.os_name}, ${matrix.package_manager}`, - }; } }); @@ -580,6 +583,9 @@ jobs: resultPkg += `\`\`\``; core.setOutput('SLACK_PROJ_DURATION', trimSpace(resultPkg)); + // instant check on manual runs + console.log(trimSpace(resultPkg)); + let resultPm = ` \`\`\` | PM | Total time | @@ -590,6 +596,9 @@ jobs: resultPm += `\`\`\``; core.setOutput('SLACK_PM_DURATION', trimSpace(resultPm)); + // instant check on manual runs + console.log(trimSpace(resultPm)); + report-failure: if: ${{ failure() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }} needs: process-result