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+ 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