Skip to content

Commit 61a9b06

Browse files
run test groups in mac
1 parent e83d828 commit 61a9b06

File tree

3 files changed

+366
-13
lines changed

3 files changed

+366
-13
lines changed
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: Build Linux and Windows
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
refLsp4ij:
7+
description: 'Reference/branch for Lsp4ij checkout'
8+
type: string
9+
required: true
10+
default: main
11+
lsp4ijBranch:
12+
description: 'PR number or branch name for Artifact upload'
13+
type: string
14+
required: true
15+
useLocalPlugin:
16+
description: 'Use lsp4ij locally'
17+
required: true
18+
type: boolean
19+
default: false
20+
refLTITag:
21+
description: 'Reference LTI Tag/Branch'
22+
type: string
23+
required: true
24+
default: main
25+
workflow_dispatch:
26+
inputs:
27+
useLocalPlugin:
28+
description: 'Use lsp4ij locally'
29+
required: true
30+
type: boolean
31+
default: false
32+
lsp4ijPrNumber:
33+
description: 'Run build with an LSP4IJ PR. Make sure to enter the LSP4IJ PR number in the "Reference/branch/PR for LSP4IJ checkout" input box.'
34+
required: true
35+
type: boolean
36+
default: false
37+
refLsp4ij:
38+
description: 'Reference/branch/PR for LSP4IJ checkout'
39+
type: string
40+
required: true
41+
default: main
42+
refLTITag:
43+
description: 'Reference LTI Tag/Branch'
44+
type: string
45+
required: false
46+
default: main
47+
push:
48+
branches: '**'
49+
pull_request:
50+
branches: [ main, intellij-2025.3-support ]
51+
52+
jobs:
53+
fetch_merge_commit_sha_from_lsp4ij_PR:
54+
runs-on: ubuntu-latest
55+
outputs:
56+
pr_details: ${{ steps.extract.outputs.pr_details }}
57+
checkout_name: ${{ steps.extract.outputs.checkout_name }}
58+
env:
59+
API_URL: https://api.github.com/repos/redhat-developer/lsp4ij/pulls
60+
REF_LSP4IJ: ${{ inputs.refLsp4ij }}
61+
LSP4IJ_BRANCH: ${{ inputs.lsp4ijBranch }}
62+
name: Fetch Commit ${{ inputs.refLsp4ij || '' }}
63+
steps:
64+
- name: Extract Merge Commit SHA
65+
shell: bash
66+
id: extract
67+
run: |
68+
pr_details="${{ env.REF_LSP4IJ }}"
69+
checkout_name="${{ env.LSP4IJ_BRANCH }}"
70+
71+
if [ "${{ inputs.lsp4ijPrNumber }}" == "true" ]; then
72+
url="${{ env.API_URL }}/${{ env.REF_LSP4IJ }}"
73+
pr_detail=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$url")
74+
pr_details=$(jq -r '.merge_commit_sha' <<< "$pr_detail" | xargs)
75+
echo "Merge commit SHA of PR ${{ env.REF_LSP4IJ }}: $pr_details"
76+
checkout_name="${{ env.REF_LSP4IJ }}"
77+
if [[ "$pr_details" == "null" ]]; then
78+
echo "::warning file=::The merge commit SHA of the entered PR is 'null'. Please try again later or use a different PR number."
79+
fi
80+
elif [ -z "$pr_details" ]; then
81+
echo "No LSP4IJ checkout found. Using default case."
82+
elif [ -z "$checkout_name" ]; then
83+
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
84+
checkout_name="${{ env.REF_LSP4IJ }}"
85+
else
86+
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
87+
fi
88+
89+
# Set output for further steps
90+
echo "pr_details=$pr_details" >> $GITHUB_OUTPUT
91+
echo "checkout_name=$checkout_name" >> $GITHUB_OUTPUT
92+
93+
build:
94+
needs: fetch_merge_commit_sha_from_lsp4ij_PR
95+
runs-on: ${{ matrix.os }}
96+
name: ${{ matrix.runtime }}
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
runtime: [ linux, windows ]
101+
include:
102+
- runtime: linux
103+
os: ubuntu-latest
104+
- runtime: windows
105+
os: windows-latest
106+
env:
107+
USE_LOCAL_PLUGIN: ${{ inputs.useLocalPlugin || false }}
108+
REF_LSP4IJ: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
109+
LSP4IJ_BRANCH: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
110+
REF_LTI_TAG: ${{ inputs.refLTITag }}
111+
steps:
112+
- name: Configure pagefile
113+
if: contains(matrix.os, 'windows')
114+
uses: al-cheb/[email protected]
115+
with:
116+
minimum-size: 8GB
117+
maximum-size: 10GB
118+
disk-root: "C:"
119+
- name: 'Checkout liberty-tools-intellij'
120+
uses: actions/checkout@v4
121+
with:
122+
path: liberty-tools-intellij
123+
ref: ${{ env.REF_LTI_TAG }}
124+
- name: 'Install required integration test software'
125+
working-directory: ./liberty-tools-intellij
126+
run: bash ./src/test/resources/ci/scripts/setup.sh
127+
128+
# Checkout and build lsp4ij only if USE_LOCAL_PLUGIN is true
129+
- name: 'Checkout lsp4ij'
130+
if: ${{ inputs.useLocalPlugin == true }}
131+
uses: actions/checkout@v4
132+
with:
133+
repository: redhat-developer/lsp4ij
134+
path: lsp4ij
135+
ref: ${{ env.REF_LSP4IJ }}
136+
- name: 'Build Lsp4ij'
137+
if: ${{ inputs.useLocalPlugin == true }}
138+
working-directory: ./lsp4ij
139+
run: bash ./gradlew buildPlugin
140+
# This step is retained to support the 24.0.9 tag running in the cron job, as it requires an unzipped LSP4IJ.
141+
- name: 'Unzip lsp4ij file'
142+
if: ${{ inputs.useLocalPlugin == true }}
143+
working-directory: ./lsp4ij/build/distributions
144+
run: |
145+
unzip -o '*.zip' -d .
146+
147+
- name: 'Build Liberty-Tools-Intellij'
148+
working-directory: ./liberty-tools-intellij
149+
run: bash ./gradlew buildPlugin -PuseLocal=${{ env.USE_LOCAL_PLUGIN }}
150+
- name: 'Archive artifacts'
151+
if: ${{ runner.os == 'Linux' && !failure() }}
152+
uses: actions/[email protected]
153+
with:
154+
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
155+
path: |
156+
./**/*liberty-tools-intellij*.zip
157+
./**/libs/*liberty-tools-intellij*.jar
158+
if-no-files-found: warn
159+
retention-days: 7
160+
- name: 'Run tests'
161+
id: run_tests
162+
working-directory: ./liberty-tools-intellij
163+
run: bash ./gradlew test
164+
- name: 'Archive Test logs and reports'
165+
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
166+
uses: actions/[email protected]
167+
with:
168+
name: ${{ matrix.runtime }}-test-report-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
169+
path: |
170+
liberty-tools-intellij/build/reports/

.github/workflows/build-mac.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Build Mac
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
refLsp4ij:
7+
description: 'Reference/branch for Lsp4ij checkout'
8+
type: string
9+
required: true
10+
default: main
11+
lsp4ijBranch:
12+
description: 'PR number or branch name for Artifact upload'
13+
type: string
14+
required: true
15+
useLocalPlugin:
16+
description: 'Use lsp4ij locally'
17+
required: true
18+
type: boolean
19+
default: false
20+
refLTITag:
21+
description: 'Reference LTI Tag/Branch'
22+
type: string
23+
required: true
24+
default: main
25+
26+
jobs:
27+
fetch_merge_commit_sha_from_lsp4ij_PR:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
pr_details: ${{ steps.extract.outputs.pr_details }}
31+
checkout_name: ${{ steps.extract.outputs.checkout_name }}
32+
env:
33+
API_URL: https://api.github.com/repos/redhat-developer/lsp4ij/pulls
34+
REF_LSP4IJ: ${{ inputs.refLsp4ij }}
35+
LSP4IJ_BRANCH: ${{ inputs.lsp4ijBranch }}
36+
name: Fetch Commit ${{ inputs.refLsp4ij || '' }}
37+
steps:
38+
- name: Extract Merge Commit SHA
39+
shell: bash
40+
id: extract
41+
run: |
42+
pr_details="${{ env.REF_LSP4IJ }}"
43+
checkout_name="${{ env.LSP4IJ_BRANCH }}"
44+
45+
if [ -z "$pr_details" ]; then
46+
echo "No LSP4IJ checkout found. Using default case."
47+
elif [ -z "$checkout_name" ]; then
48+
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
49+
checkout_name="${{ env.REF_LSP4IJ }}"
50+
else
51+
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
52+
fi
53+
54+
# Set output for further steps
55+
echo "pr_details=$pr_details" >> $GITHUB_OUTPUT
56+
echo "checkout_name=$checkout_name" >> $GITHUB_OUTPUT
57+
58+
build:
59+
needs: fetch_merge_commit_sha_from_lsp4ij_PR
60+
runs-on: macOS-14
61+
name: mac - ${{ matrix.test-group }}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
test-group: [ Maven-MicroProfile, Gradle-MicroProfile, Maven-Custom-Liberty-Install, Gradle-Custom-Liberty-Install, Maven-MP-Config, Gradle-MP-Config, Maven-MP-SID, Gradle-MP-SID, Maven-NLT-REST, Gradle-NLT-REST, Gradle-Language-Server, Gradle-MP-Language-Server, Gradle-Jakarta-Language-Server, Maven-Multi-Module-MP ]
66+
include:
67+
- test-group: Maven-MicroProfile
68+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPProjectTest
69+
- test-group: Gradle-MicroProfile
70+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPProjectTest
71+
- test-group: Maven-Custom-Liberty-Install
72+
test-class: io.openliberty.tools.intellij.it.MavenSingleModCustomWLPInstallProjectTest
73+
- test-group: Gradle-Custom-Liberty-Install
74+
test-class: io.openliberty.tools.intellij.it.GradleSingleModCustomWLPInstallProjectTest
75+
- test-group: Maven-MP-Config
76+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPCfgProjectTest
77+
- test-group: Gradle-MP-Config
78+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPCfgProjectTest
79+
- test-group: Maven-MP-SID
80+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPSIDProjectTest
81+
- test-group: Gradle-MP-SID
82+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPSIDProjectTest
83+
- test-group: Maven-NLT-REST
84+
test-class: io.openliberty.tools.intellij.it.MavenSingleModNLTRestProjectTest
85+
- test-group: Gradle-NLT-REST
86+
test-class: io.openliberty.tools.intellij.it.GradleSingleModNLTRestProjectTest
87+
- test-group: Gradle-Language-Server
88+
test-class: io.openliberty.tools.intellij.it.GradleSingleModLSTest
89+
- test-group: Gradle-MP-Language-Server
90+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPLSTest
91+
- test-group: Gradle-Jakarta-Language-Server
92+
test-class: io.openliberty.tools.intellij.it.GradleSingleModJakartaLSTest
93+
- test-group: Maven-Multi-Module-MP
94+
test-class: io.openliberty.tools.intellij.it.MavenMPMultipleProjectTest
95+
env:
96+
USE_LOCAL_PLUGIN: ${{ inputs.useLocalPlugin || false }}
97+
REF_LSP4IJ: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
98+
LSP4IJ_BRANCH: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
99+
REF_LTI_TAG: ${{ inputs.refLTITag }}
100+
TEST_CLASS: ${{ matrix.test-class }}
101+
steps:
102+
- name: 'Checkout liberty-tools-intellij'
103+
uses: actions/checkout@v4
104+
with:
105+
path: liberty-tools-intellij
106+
ref: ${{ env.REF_LTI_TAG }}
107+
- name: 'Install required integration test software'
108+
working-directory: ./liberty-tools-intellij
109+
run: bash ./src/test/resources/ci/scripts/setup.sh
110+
111+
# Checkout and build lsp4ij only if USE_LOCAL_PLUGIN is true
112+
- name: 'Checkout lsp4ij'
113+
if: ${{ inputs.useLocalPlugin == true }}
114+
uses: actions/checkout@v4
115+
with:
116+
repository: redhat-developer/lsp4ij
117+
path: lsp4ij
118+
ref: ${{ env.REF_LSP4IJ }}
119+
- name: 'Build Lsp4ij'
120+
if: ${{ inputs.useLocalPlugin == true }}
121+
working-directory: ./lsp4ij
122+
run: bash ./gradlew buildPlugin
123+
# This step is retained to support the 24.0.9 tag running in the cron job, as it requires an unzipped LSP4IJ.
124+
- name: 'Unzip lsp4ij file'
125+
if: ${{ inputs.useLocalPlugin == true }}
126+
working-directory: ./lsp4ij/build/distributions
127+
run: |
128+
unzip -o '*.zip' -d .
129+
130+
- name: 'Build Liberty-Tools-Intellij'
131+
working-directory: ./liberty-tools-intellij
132+
run: bash ./gradlew buildPlugin -PuseLocal=${{ env.USE_LOCAL_PLUGIN }}
133+
- name: 'Run tests'
134+
id: run_tests
135+
working-directory: ./liberty-tools-intellij
136+
run: bash ./src/test/resources/ci/scripts/run.sh
137+
- name: 'Archive Test logs and reports'
138+
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
139+
uses: actions/[email protected]
140+
with:
141+
name: mac-${{ matrix.test-group }}-test-report-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
142+
path: |
143+
liberty-tools-intellij/build/reports/

0 commit comments

Comments
 (0)