Skip to content

Commit 502aca5

Browse files
authored
chore: merge workflows onto one (#982)
* chore: merge workflows Signed-off-by: Stephane Bouchet <[email protected]>
1 parent 533c9d2 commit 502aca5

20 files changed

+172
-229
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
version: 2
44
updates:
5-
# Updates for Github Actions
5+
# Updates for GitHub Actions
66
- package-ecosystem: "github-actions"
77
directory: "/"
88
schedule:

.github/workflows/ci.yml

+107-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
pull_request:
88
branches: [ main ]
99

10-
permissions:
11-
pull-requests: write
12-
1310
concurrency:
1411
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1512
cancel-in-progress: true
@@ -61,6 +58,8 @@ jobs:
6158
kubernetes-integration-tests:
6259
runs-on: ubuntu-latest
6360
needs: ci
61+
permissions:
62+
pull-requests: write
6463

6564
steps:
6665
- uses: actions/checkout@v4
@@ -71,7 +70,7 @@ jobs:
7170
distribution: 'temurin'
7271
cache: 'gradle'
7372
- name: Setup Gradle
74-
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 #v3.5.0
73+
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 #v4.2.1
7574
with:
7675
add-job-summary: 'on-failure'
7776
add-job-summary-as-pr-comment: 'on-failure'
@@ -102,4 +101,107 @@ jobs:
102101
name: kubernetes-integration-tests-reports
103102
path: |
104103
build/test-results/**/*.xml
105-
build/jacoco/
104+
build/jacoco/
105+
106+
cluster-integration-ui-tests:
107+
name: Run Integration UI Tests with KIND
108+
runs-on: ubuntu-latest
109+
needs: kubernetes-integration-tests
110+
permissions:
111+
checks: write
112+
contents: read
113+
pull-requests: write
114+
115+
steps:
116+
- uses: actions/checkout@v4
117+
- name: Set up JDK 17
118+
uses: actions/setup-java@v4
119+
with:
120+
java-version: 17
121+
distribution: 'temurin'
122+
cache: 'gradle'
123+
- name: Setup Gradle
124+
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 #v4.2.1
125+
with:
126+
add-job-summary: 'on-failure'
127+
add-job-summary-as-pr-comment: 'on-failure'
128+
validate-wrappers: true
129+
- uses: container-tools/kind-action@0ad70e2299366b0e1552c7240f4e4567148f723e # v2.0.4
130+
name: Start cluster
131+
# service setup disabled along with service test because service binding operator is deprecated, and postgres service isn't available anymore
132+
# - name: Setup cluster
133+
# run: |
134+
# curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.26.0/install.sh | bash -s v0.26.0
135+
# kubectl create -f https://operatorhub.io/install/service-binding-operator.yaml
136+
# kubectl create -f https://operatorhub.io/install/stable/cloud-native-postgresql.yaml
137+
# nb=0
138+
# echo -n "Waiting for operator to show up "
139+
# while [ "$nb" != "2" ]
140+
# do
141+
# echo -n "."
142+
# sleep 1
143+
# nb=`kubectl get pods -n operators --no-headers --ignore-not-found | grep Running | wc -l`
144+
# done
145+
- name: Grant execute permission for gradlew
146+
run: chmod +x gradlew
147+
- name: Play cluster integration UI tests
148+
env:
149+
CLUSTER_ALREADY_LOGGED_IN: 'true'
150+
run: xvfb-run --server-args="-screen 0 1920x1080x24" ./gradlew integrationUITest --continue --info
151+
- name: Publish tests reports
152+
uses: actions/upload-artifact@v4
153+
if: always()
154+
with:
155+
name: cluster-integration-ui-tests-reports
156+
path: |
157+
build/test-results/**/*.xml
158+
build/jacoco/
159+
- name: Publish screenshots as artifacts
160+
if: failure()
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: cluster-integration-ui-tests-screenshots
164+
path: ./build/screenshots$
165+
166+
167+
no-context-integration-ui-tests:
168+
name: Run Integration UI Tests with NO Context
169+
runs-on: ubuntu-latest
170+
needs: kubernetes-integration-tests
171+
permissions:
172+
checks: write
173+
contents: read
174+
pull-requests: write
175+
176+
steps:
177+
- uses: actions/checkout@v4
178+
- name: Set up JDK 17
179+
uses: actions/setup-java@v4
180+
with:
181+
java-version: 17
182+
distribution: 'temurin'
183+
cache: 'gradle'
184+
- name: Setup Gradle
185+
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 #v4.2.1
186+
with:
187+
add-job-summary: 'on-failure'
188+
add-job-summary-as-pr-comment: 'on-failure'
189+
validate-wrappers: true
190+
- name: Grant execute permission for gradlew
191+
run: chmod +x gradlew
192+
- name: Play integration UI tests
193+
run: xvfb-run --server-args="-screen 0 1920x1080x24" ./gradlew integrationUITest --continue
194+
- name: Publish tests reports
195+
uses: actions/upload-artifact@v4
196+
if: always()
197+
with:
198+
name: no-context-integration-ui-tests-reports
199+
path: |
200+
build/test-results/**/*.xml
201+
build/jacoco/
202+
- name: Publish screenshots as artifacts
203+
if: failure()
204+
uses: actions/upload-artifact@v4
205+
with:
206+
name: no-context-integration-ui-tests-screenshots
207+
path: ./build/screenshots

.github/workflows/cluster_integration_ui_tests.yml

-64
This file was deleted.

.github/workflows/no_context_integration_ui_tests.yml

-45
This file was deleted.

.github/workflows/validate_IJ_versions.yml

+31-24
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,34 @@ jobs:
1010

1111
steps:
1212
# Free GitHub Actions Environment Disk Space
13-
- name: Maximize Build Space
14-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
15-
with:
16-
tool-cache: false
17-
large-packages: false
18-
- name: Checkout Code
19-
uses: actions/checkout@v4
20-
- name: Set up JDK 17
21-
uses: actions/setup-java@v4
22-
with:
23-
java-version: 17
24-
distribution: 'temurin'
25-
cache: 'gradle'
26-
- name: Grant execute permission for gradlew
27-
run: chmod +x gradlew
28-
- name: Verify with Gradle
29-
run: ./gradlew verifyPlugin
30-
- name: Upload report
31-
uses: actions/upload-artifact@v4
32-
if: always()
33-
with:
34-
name: verifier-report
35-
path: build/reports/pluginVerifier
36-
if-no-files-found: ignore
13+
- name: Maximize Build Space
14+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
15+
with:
16+
tool-cache: false
17+
large-packages: false
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: 17
24+
distribution: 'temurin'
25+
cache: 'gradle'
26+
- name: Grant execute permission for gradlew
27+
run: chmod +x gradlew
28+
- name: Verify with Gradle
29+
run: |
30+
./gradlew verifyPlugin
31+
REPORTS=$(cat ${{ github.workspace }}/build/reports/pluginVerifier/*/report.md | sed 's/^#/##/')
32+
echo "$REPORTS" >> $GITHUB_STEP_SUMMARY
33+
- name: Upload report
34+
uses: actions/upload-artifact@v4
35+
if: always()
36+
with:
37+
name: verifier-reports
38+
path: build/reports/pluginVerifier
39+
if-no-files-found: ignore
40+
- name: Clean up
41+
run: |
42+
./gradlew clean
43+
if: always()

gradle/libs.versions.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ awaitility = "4.2.2"
1616
annotations = "24.0.0"
1717

1818
# plugins
19-
gradleIntelliJPlugin = "2.2.0"
19+
gradleIntelliJPlugin = "2.2.1"
2020
sonarqube = "5.1.0.4882"
2121

2222
[libraries]
@@ -43,4 +43,4 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an
4343

4444
[plugins]
4545
gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
46-
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
46+
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }

src/it/java/org/jboss/tools/intellij/openshift/test/ui/AbstractBaseTest.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected static void logOut() {
7979
LOGGER.info("Starting logout process...");
8080
try {
8181
KubeConfigUtility.removeKubeConfig();
82-
sleep(2000);
82+
8383
currentClusterUrl = DEFAULT_CLUSTER_URL;
8484

8585
OpenshiftView view = robot.find(OpenshiftView.class);
@@ -107,16 +107,6 @@ protected static void logOut() {
107107
}
108108
}
109109

110-
protected static void sleep(long ms) {
111-
LOGGER.info("Putting thread into sleep for: {} ms", ms);
112-
try {
113-
Thread.sleep(ms);
114-
} catch (InterruptedException e) {
115-
LOGGER.error("Sleep interrupted: {}", e.getMessage());
116-
throw new RuntimeException(e);
117-
}
118-
}
119-
120110
/**
121111
* Captures a screenshot and saves it with the given comment.
122112
*
@@ -134,6 +124,7 @@ protected static void captureScreenshot(String comment) {
134124
LOGGER.error("Failed to capture screenshot: {}", e.getMessage(), e);
135125
}
136126
}
127+
137128
private static class TestWatcherImpl implements TestWatcher {
138129
@Override
139130
public void testFailed(ExtensionContext context, Throwable cause) {

src/it/java/org/jboss/tools/intellij/openshift/test/ui/ClusterTestsSuite.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
@IncludeClassNamePatterns({"^.*Test$"})
3434
public class ClusterTestsSuite {
3535
@BeforeAll
36-
public static void setUp() {
36+
static void setUp() {
3737
KubeConfigUtility.backupKubeConfig();
3838
}
3939

4040
@AfterAll
41-
public static void tearDown() {
41+
static void tearDown() {
4242
KubeConfigUtility.restoreKubeConfig();
4343
}
4444
}

0 commit comments

Comments
 (0)