Add support for arm64 Windows (#927)

* add support for arm64 Windows

* revert 7z to exe

* add comment

---------

Co-authored-by: aparnajyothi-y <147696841+aparnajyothi-y@users.noreply.github.com>
This commit is contained in:
Dmitry Shibanov
2024-02-07 05:42:16 +01:00
committed by GitHub
parent d86ebcd40b
commit 60edb5dd54
6 changed files with 75 additions and 14 deletions

View File

@ -2,6 +2,7 @@ import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as tc from '@actions/tool-cache';
import * as cache from '@actions/cache';
import * as io from '@actions/io';
import fs from 'fs';
import path from 'path';
@ -24,6 +25,10 @@ describe('main tests', () => {
let startGroupSpy: jest.SpyInstance;
let endGroupSpy: jest.SpyInstance;
let whichSpy: jest.SpyInstance;
let existsSpy: jest.SpyInstance;
let getExecOutputSpy: jest.SpyInstance;
let getNodeVersionFromFileSpy: jest.SpyInstance;
@ -55,6 +60,8 @@ describe('main tests', () => {
inSpy = jest.spyOn(core, 'getInput');
inSpy.mockImplementation(name => inputs[name]);
whichSpy = jest.spyOn(io, 'which');
getExecOutputSpy = jest.spyOn(exec, 'getExecOutput');
findSpy = jest.spyOn(tc, 'find');
@ -140,6 +147,10 @@ describe('main tests', () => {
return {stdout: obj[command], stderr: '', exitCode: 0};
});
whichSpy.mockImplementation(cmd => {
return `some/${cmd}/path`;
});
await util.printEnvDetailsAndSetOutput();
expect(setOutputSpy).toHaveBeenCalledWith('node-version', obj['node']);

View File

@ -248,6 +248,9 @@ describe('setup-node', () => {
const toolPath = path.normalize('/cache/node/12.16.2/x64');
exSpy.mockImplementation(async () => '/some/other/temp/path');
cacheSpy.mockImplementation(async () => toolPath);
whichSpy.mockImplementation(cmd => {
return `some/${cmd}/path`;
});
await main.run();