Skip to content

Commit ffc2ac7

Browse files
committed
Add github actions caching to speed up test runs
Signed-off-by: Adam Wisniewski <awisniew@us.ibm.com>
1 parent 43920c2 commit ffc2ac7

File tree

3 files changed

+46
-19
lines changed

3 files changed

+46
-19
lines changed

.github/workflows/run-regression-tests.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,37 @@ jobs:
2929
- name: 'Setup: Checkout plugin'
3030
uses: actions/checkout@v2
3131

32+
# Cache Maven dependencies
33+
- name: 'Cache: Maven repository'
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.m2/repository
37+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
38+
restore-keys: |
39+
${{ runner.os }}-maven-
40+
41+
# Cache Gradle dependencies
42+
- name: 'Cache: Gradle'
43+
uses: actions/cache@v4
44+
with:
45+
path: |
46+
~/.gradle/caches
47+
~/.gradle/wrapper
48+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
49+
restore-keys: |
50+
${{ runner.os }}-gradle-
51+
52+
# Cache downloaded tools (JDK, Maven, Gradle)
53+
- name: 'Cache: Downloaded tools'
54+
uses: actions/cache@v4
55+
with:
56+
path: test-tools/liberty-dev-tools
57+
key: ${{ runner.os }}-tools-jdk21.0.3-maven3.9.6-gradle8.8
58+
restore-keys: |
59+
${{ runner.os }}-tools-
60+
3261
# Install the required software.
33-
- name: 'Setup: Install required software'
62+
- name: 'Setup: Install required software'
3463
run: bash ./tests/resources/ci/scripts/setup.sh
3564

3665
# Build the plugin.

tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<providerHint>junit5</providerHint>
4040
<trimStackTrace>false</trimStackTrace>
4141
<runOrder>alphabetical</runOrder>
42-
<forkedProcessTimeoutInSeconds>3600</forkedProcessTimeoutInSeconds>
42+
<forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
4343
<systemProperties>
4444
<org.eclipse.swtbot.search.timeout>20000</org.eclipse.swtbot.search.timeout>
4545
<io.liberty.tools.eclipse.tests.mvn.logfile>${mvnLogFile}</io.liberty.tools.eclipse.tests.mvn.logfile>

tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.Iterator;
2828
import java.util.List;
2929

30-
import org.eclipse.core.runtime.Platform;
3130
import org.eclipse.swt.SWT;
3231
import org.eclipse.swt.widgets.Button;
3332
import org.eclipse.swt.widgets.Combo;
@@ -60,6 +59,7 @@
6059
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
6160
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
6261
import org.eclipse.ui.IWorkbench;
62+
import org.eclipse.ui.IWorkbenchWindow;
6363
import org.eclipse.ui.PlatformUI;
6464
import org.eclipse.ui.WorkbenchException;
6565
import org.eclipse.ui.part.ViewPart;
@@ -239,11 +239,11 @@ public static void openJavaPerspectiveViaMenu() {
239239

240240
public static SWTBotTable getDashboardTable() {
241241
openDashboardUsingToolbar();
242-
242+
243243
// Ensure the dashboard view is actually shown and has focus
244244
// This prevents finding the wrong view (like ConsoleView) when the console takes focus after server start
245245
Object dashboardView = findGlobal(DASHBOARD_VIEW_TITLE, Option.factory().widgetClass(ViewPart.class).build());
246-
246+
247247
// Explicitly show and activate the dashboard view to ensure it has focus
248248
if (dashboardView instanceof ViewPart) {
249249
final ViewPart vp = (ViewPart) dashboardView;
@@ -261,11 +261,11 @@ public void run() {
261261
}
262262
}
263263
});
264-
264+
265265
// Give the UI a moment to update after activation
266-
pause(500);
266+
MagicWidgetFinder.pause(500);
267267
}
268-
268+
269269
Table table = ((DashboardView) dashboardView).getTable();
270270
return new SWTBotTable(table);
271271
}
@@ -417,22 +417,21 @@ public static SWTBotMenu getAppDebugAsMenu(SWTWorkbenchBot bot, String item) {
417417
public static void setBuildCmdPathInPreferences(SWTWorkbenchBot bot, String buildTool) {
418418
// Use Eclipse preference store API directly instead of UI navigation
419419
// This avoids issues with menu accessibility in headless CI environments
420-
420+
421421
String finalMvnExecutableLoc = AbstractLibertyPluginSWTBotTest.getMvnCmdPath();
422422
String finalGradleExecutableLoc = AbstractLibertyPluginSWTBotTest.getGradleCmdPath();
423-
423+
424424
// Get the preference store for the Liberty Tools plugin
425-
org.eclipse.jface.preference.IPreferenceStore prefStore =
426-
new org.eclipse.ui.preferences.ScopedPreferenceStore(
425+
org.eclipse.jface.preference.IPreferenceStore prefStore = new org.eclipse.ui.preferences.ScopedPreferenceStore(
427426
org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE,
428427
"io.openliberty.tools.eclipse.ui");
429-
428+
430429
if ("Maven".equals(buildTool)) {
431430
prefStore.setValue("MVNPATH", finalMvnExecutableLoc);
432431
} else if ("Gradle".equals(buildTool)) {
433432
prefStore.setValue("GRADLEPATH", finalGradleExecutableLoc);
434433
}
435-
434+
436435
// Save the preference store
437436
if (prefStore instanceof org.eclipse.ui.preferences.ScopedPreferenceStore) {
438437
try {
@@ -447,20 +446,19 @@ public static void setBuildCmdPathInPreferences(SWTWorkbenchBot bot, String buil
447446
public static void unsetBuildCmdPathInPreferences(SWTWorkbenchBot bot, String buildTool) {
448447
// Use Eclipse preference store API directly instead of UI navigation
449448
// This avoids issues with menu accessibility in headless CI environments
450-
449+
451450
// Get the preference store for the Liberty Tools plugin
452-
org.eclipse.jface.preference.IPreferenceStore prefStore =
453-
new org.eclipse.ui.preferences.ScopedPreferenceStore(
451+
org.eclipse.jface.preference.IPreferenceStore prefStore = new org.eclipse.ui.preferences.ScopedPreferenceStore(
454452
org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE,
455453
"io.openliberty.tools.eclipse.ui");
456-
454+
457455
// Reset to default values (empty strings)
458456
if ("Maven".equals(buildTool)) {
459457
prefStore.setToDefault("MVNPATH");
460458
} else if ("Gradle".equals(buildTool)) {
461459
prefStore.setToDefault("GRADLEPATH");
462460
}
463-
461+
464462
// Save the preference store
465463
if (prefStore instanceof org.eclipse.ui.preferences.ScopedPreferenceStore) {
466464
try {

0 commit comments

Comments
 (0)