From 8a1303f3751680d1c0df57fda24b77225e5ed321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= Date: Sat, 1 Jul 2023 12:27:54 +0200 Subject: [PATCH] /deploy: only build mingw-w64-clang for ARM64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we're not using clang to build for other architectures, so we don't need to build it for other architectures Signed-off-by: Matthias Aßhauer --- GitForWindowsHelper/slash-commands.js | 8 +++++--- __tests__/index.test.js | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/GitForWindowsHelper/slash-commands.js b/GitForWindowsHelper/slash-commands.js index c562197..ebe81dd 100644 --- a/GitForWindowsHelper/slash-commands.js +++ b/GitForWindowsHelper/slash-commands.js @@ -171,9 +171,11 @@ module.exports = async (context, req) => { ) } } else { - toTrigger.push( - { displayArchitecture: 'i686/x86_64' } - ) + if (package_name !== 'mingw-w64-clang') { + toTrigger.push( + { displayArchitecture: 'i686/x86_64' } + ) + } if (needsSeparateARM64Build(package_name)) { toTrigger.push( { architecture: 'aarch64', displayArchitecture: 'arm64' } diff --git a/__tests__/index.test.js b/__tests__/index.test.js index 503206f..3f33eca 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -109,6 +109,9 @@ let mockGitHubApiRequest = jest.fn((_context, _token, method, requestPath, paylo if (method === 'GET' && requestPath.endsWith('/pulls/74')) return { head: { sha: 'a7e4b90' } } + if (method === 'GET' && requestPath.endsWith('/pulls/75')) return { + head: { sha: '45b8fd0' } + } if (method === 'GET' && requestPath.endsWith('/pulls/90')) return { head: { sha: '265d07e' } } @@ -439,6 +442,29 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`) expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686']) }) + +testIssueComment('/deploy mingw-w64-clang', { + issue: { + number: 75, + title: 'shrink LLVM', + body: '', + pull_request: { + html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/75' + } + }, + repository: { + name: 'MINGW-packages' + } +}, async (context) => { + expect(await index(context, context.req)).toBeUndefined() + expect(context.res.body).toEqual(`I edited the comment: appended-comment-body-existing comment body + +The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`) + expect(mockQueueCheckRun).toHaveBeenCalledTimes(1) + expect(mockUpdateCheckRun).toHaveBeenCalledTimes(1) + expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64']) +}) + testIssueComment('/add release note', { issue: { number: 4281,