mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-02-04 02:43:19 +08:00
Support new unity versioning scheme with regex matching groups (#264)
* Support new unity versioning scheme with regex matching groups * Update github action packages * Pin windows runner image version to 2022. Fix artifact name. Remove max-parallel cap for tests
This commit is contained in:
@@ -2,16 +2,15 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const UnityVersionParser = {
|
||||
get versionPattern() {
|
||||
return /20\d{2}\.\d\.\w{3,4}|3/;
|
||||
},
|
||||
|
||||
parse(projectVersionTxt) {
|
||||
const matches = projectVersionTxt.match(UnityVersionParser.versionPattern);
|
||||
if (!matches || matches.length === 0) {
|
||||
throw new Error(`Failed to parse version from "${projectVersionTxt}".`);
|
||||
const versionRegex = /m_EditorVersion: (\d+\.\d+\.\d+[A-Za-z]?\d+)/;
|
||||
const matches = projectVersionTxt.match(versionRegex);
|
||||
|
||||
if (!matches || matches.length < 2) {
|
||||
throw new Error(`Failed to extract version from "${projectVersionTxt}".`);
|
||||
}
|
||||
return matches[0];
|
||||
|
||||
return matches[1];
|
||||
},
|
||||
|
||||
read(projectPath) {
|
||||
|
||||
Reference in New Issue
Block a user