Skip to content

Commit 95fa339

Browse files
committed
chore: fix integration tests
Signed-off-by: Stephane Bouchet <[email protected]>
1 parent 7e53d3d commit 95fa339

File tree

3 files changed

+81
-164
lines changed

3 files changed

+81
-164
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Main CI
2+
name: Java CI with Gradle
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
16+
configure_sonar:
17+
runs-on: ubuntu-latest
18+
if: github.event_name == 'pull_request'
19+
20+
steps:
21+
- name: Save Sonar config on PR
22+
run: |
23+
mkdir -p ./prInfo
24+
echo ${{ github.event.number }} > ./prInfo/PR
25+
echo ${{ github.base_ref }} > ./prInfo/base_ref
26+
echo ${{ github.head_ref }} > ./prInfo/head_ref
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: prInfo
30+
path: prInfo/
31+
32+
mainidewindow_idestatusbar_screenshot:
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: [ ubuntu-latest, macos-latest, windows-latest ]
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Set up JDK 17
40+
uses: actions/setup-java@v4
41+
with:
42+
java-version: 17
43+
distribution: 'temurin'
44+
cache: 'gradle'
45+
- name: Run integration tests
46+
run: |
47+
export DISPLAY=:99.0
48+
Xvfb -ac :99 -screen 0 1920x1080x24 &
49+
cd src/test-project
50+
chmod +x gradlew
51+
./gradlew clean integrationUITest --warning-mode none --tests com.redhat.devtools.intellij.commonuitest.utils.* --tests com.redhat.devtools.intellij.commonuitest.fixtures.test.mainidewindow.idestatusbar.*
52+
- uses: actions/upload-artifact@v4
53+
with:
54+
name: ${{ matrix.os }}-mainidewindow.idestatusbar-test-reports
55+
path: src/test-project/build/reports/tests/test
56+
if: always()
57+
- name: Archiving screenshots
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: ${{ matrix.os }}-mainidewindow.idestatusbar-screenshots
61+
path: src/test-project/build/screenshots/*
62+
if: always()
63+
- name: Archiving StepLogger logs
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: ${{ matrix.os }}-mainidewindow.idestatusbar-steplogger-logs
67+
path: src/test-project/build/test-results/*
68+
if: always()

.github/workflows/mainidewindow.idestatusbar_screenshot.yml

Lines changed: 0 additions & 134 deletions
This file was deleted.

.github/workflows/sonar.yml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Sonar
22
on:
33
workflow_run:
4-
workflows: ["Java CI with Gradle - mainidewindow.idestatusbar, screenshot"]
4+
workflows: [Java CI with Gradle]
55
types:
66
- completed
77
jobs:
@@ -19,36 +19,19 @@ jobs:
1919
java-version: 21
2020
distribution: 'temurin'
2121
cache: 'gradle'
22-
- name: Download artifacts
23-
uses: actions/[email protected]
22+
- name: Download 'mainidewindow.idestatusbar, screenshot' report
23+
uses: actions/download-artifact@v4
2424
with:
25-
script: |
26-
var artifacts = await github.actions.listWorkflowRunArtifacts({
27-
owner: context.repo.owner,
28-
repo: context.repo.repo,
29-
run_id: ${{github.event.workflow_run.id}},
30-
});
31-
for (var artifact of artifacts.data.artifacts) {
32-
if (artifact.name == 'linux-integration-test-reports' || artifact.name == 'ubuntu-latest-test-reports' || artifact.name == 'prInfo') {
33-
var zipfile = await github.actions.downloadArtifact({
34-
owner: context.repo.owner,
35-
repo: context.repo.repo,
36-
artifact_id: artifact.id,
37-
archive_format: 'zip',
38-
});
39-
var fs = require('fs');
40-
var path = require('path');
41-
var pathFile = path.format({
42-
root: '${{github.workspace}}/',
43-
name: artifact.name,
44-
ext: '.zip'
45-
});
46-
fs.writeFileSync(pathFile, Buffer.from(zipfile.data));
47-
}
48-
}
49-
- name: Unzip artifacts
50-
run: |
51-
find . -name '*.zip' -exec sh -c 'unzip -d "${{github.workspace}}/build" "$1"' _ {} \;
25+
path: reports
26+
pattern: mainidewindow.idestatusbar-test-reports
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
run-id: ${{github.event.workflow_run.id}}
29+
- name: Download PrInfo
30+
uses: actions/download-artifact@v4
31+
with:
32+
pattern: prInfo
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
run-id: ${{github.event.workflow_run.id}}
5235
- name: Run Sonar analysis
5336
env:
5437
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)