Compare commits

...

4 Commits

Author SHA1 Message Date
WillAbides 86ea382ad0
Merge 4dedda9ac2 into b26d40294f 2024-09-01 17:19:24 +01:00
Zxilly b26d40294f
fix: add arch to cache key (#493) 2024-08-26 15:19:57 -05:00
Will Roden 4dedda9ac2 make column optional in matcher 2023-09-13 13:03:00 -05:00
Will Roden 643c7cb3e2 test for no-column match 2023-09-13 13:02:07 -05:00
4 changed files with 15 additions and 3 deletions

View File

@ -645,6 +645,16 @@ describe('setup-go', () => {
expect(annotation.message).toBe('undefined: fmt.Printl');
});
it('matches test output without a column', async () => {
const line = '/path/to/main_test.go:13: expected true but got false';
const annotation = testMatch(line);
expect(annotation).toBeDefined();
expect(annotation.line).toBe(13);
expect(annotation.column).toBe(NaN);
expect(annotation.file).toBe('/path/to/main_test.go');
expect(annotation.message).toBe('expected true but got false');
});
// 1.13.1 => 1.13.1
// 1.13 => 1.13.0
// 1.10beta1 => 1.10.0-beta.1, 1.10rc1 => 1.10.0-rc.1

3
dist/setup/index.js vendored
View File

@ -88045,6 +88045,7 @@ const cache_utils_1 = __nccwpck_require__(1678);
const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager);
const platform = process.env.RUNNER_OS;
const arch = process.arch;
const cachePaths = yield (0, cache_utils_1.getCacheDirectoryPath)(packageManagerInfo);
const dependencyFilePath = cacheDependencyPath
? cacheDependencyPath
@ -88054,7 +88055,7 @@ const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awa
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
const linuxVersion = process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
const primaryKey = `setup-go-${platform}-${arch}-${linuxVersion}go-${versionSpec}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey);

View File

@ -4,7 +4,7 @@
"owner": "go",
"pattern": [
{
"regexp": "^\\s*(.+\\.go):(?:(\\d+):(\\d+):)? (.*)",
"regexp": "^\\s*(.+\\.go):(?:(\\d+):(?:(\\d+):)?)? (.*)",
"file": 1,
"line": 2,
"column": 3,

View File

@ -15,6 +15,7 @@ export const restoreCache = async (
) => {
const packageManagerInfo = await getPackageManagerInfo(packageManager);
const platform = process.env.RUNNER_OS;
const arch = process.arch;
const cachePaths = await getCacheDirectoryPath(packageManagerInfo);
@ -31,7 +32,7 @@ export const restoreCache = async (
const linuxVersion =
process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
const primaryKey = `setup-go-${platform}-${arch}-${linuxVersion}go-${versionSpec}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(State.CachePrimaryKey, primaryKey);