Skip to content

Commit 11c47d3

Browse files
committed
Try changing directory into josm test dir for maven
Signed-off-by: Taylor Smock <smocktaylor@gmail.com>
1 parent 07f50a4 commit 11c47d3

2 files changed

Lines changed: 27 additions & 14 deletions

File tree

actions/josm_build/dist/index.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80118,13 +80118,20 @@ async function buildJosmTests(josmSource, josmRevision) {
8011880118
await (0,cache.saveCache)(["~/.ivy2/cache", "~/.ant/cache", "~/.m2", josmSource + "/tools"], `${process.platform}-${process.arch}-test-ivy-${ivyFiles}`);
8011980119
}
8012080120
await (0,exec.exec)("ant", ["-buildfile", josmSource + "/build.xml", "test-compile"]);
80121-
await (0,exec.exec)("mvn", [
80122-
"--file",
80123-
josmSource + "/test/pom.xml",
80124-
"package",
80125-
"install",
80126-
"-DskipTests",
80127-
]);
80121+
const cwd = process.cwd();
80122+
try {
80123+
process.chdir(josmSource + "/test");
80124+
await (0,exec.exec)("mvn", [
80125+
"--file",
80126+
josmSource + "/test/pom.xml",
80127+
"package",
80128+
"install",
80129+
"-DskipTests",
80130+
]);
80131+
}
80132+
finally {
80133+
process.chdir(cwd);
80134+
}
8012880135
await (0,cache.saveCache)([josmSource + "/test/build"], `josm-tests-r${josmRevision}`);
8012980136
}
8013080137
async function run() {

actions/josm_build/src/action.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,19 @@ async function buildJosmTests(
125125
);
126126
}
127127
await exec("ant", ["-buildfile", josmSource + "/build.xml", "test-compile"]);
128-
await exec("mvn", [
129-
"--file",
130-
josmSource + "/test/pom.xml",
131-
"package",
132-
"install",
133-
"-DskipTests",
134-
]);
128+
const cwd = process.cwd();
129+
try {
130+
process.chdir(josmSource + "/test");
131+
await exec("mvn", [
132+
"--file",
133+
josmSource + "/test/pom.xml",
134+
"package",
135+
"install",
136+
"-DskipTests",
137+
]);
138+
} finally {
139+
process.chdir(cwd);
140+
}
135141
await saveCache([josmSource + "/test/build"], `josm-tests-r${josmRevision}`);
136142
}
137143

0 commit comments

Comments
 (0)