Skip to content

Clean up and reorganize the LSP4IJ integration tests #2535

Clean up and reorganize the LSP4IJ integration tests

Clean up and reorganize the LSP4IJ integration tests #2535

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
useLocalPlugin:
description: 'Use lsp4ij locally'
required: true
type: boolean
default: false
lsp4ijPrNumber:
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.'
required: true
type: boolean
default: false
refLsp4ij:
description: 'Reference/branch/PR for LSP4IJ checkout'
type: string
required: true
default: main
refLTITag:
description: 'Reference LTI Tag/Branch'
type: string
required: false
default: main
push:
branches: '**'
pull_request:
branches: [ main ]
jobs:
fetch_merge_commit_sha_from_lsp4ij_PR:
runs-on: ubuntu-latest
outputs:
pr_details: ${{ steps.extract.outputs.pr_details }}
checkout_name: ${{ steps.extract.outputs.checkout_name }}
env:
API_URL: https://api.github.com/repos/redhat-developer/lsp4ij/pulls
REF_LSP4IJ: ${{ inputs.refLsp4ij }}
LSP4IJ_BRANCH: ${{ inputs.lsp4ijBranch }}
name: Fetch Commit ${{ inputs.refLsp4ij || '' }}
steps:
- name: Extract Merge Commit SHA
shell: bash
id: extract
run: |
pr_details="${{ env.REF_LSP4IJ }}"
checkout_name="${{ env.LSP4IJ_BRANCH }}"
if [ "${{ inputs.lsp4ijPrNumber }}" == "true" ]; then
url="${{ env.API_URL }}/${{ env.REF_LSP4IJ }}"
pr_detail=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$url")
pr_details=$(jq -r '.merge_commit_sha' <<< "$pr_detail" | xargs)
echo "Merge commit SHA of PR ${{ env.REF_LSP4IJ }}: $pr_details"
checkout_name="${{ env.REF_LSP4IJ }}"
if [[ "$pr_details" == "null" ]]; then
echo "::warning file=::The merge commit SHA of the entered PR is 'null'. Please try again later or use a different PR number."
fi
elif [ -z "$pr_details" ]; then
echo "No LSP4IJ checkout found. Using default case."
elif [ -z "$checkout_name" ]; then
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
checkout_name="${{ env.REF_LSP4IJ }}"
else
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
fi
# Set output for further steps
echo "pr_details=$pr_details" >> $GITHUB_OUTPUT
echo "checkout_name=$checkout_name" >> $GITHUB_OUTPUT
# Call Linux Builds
linux-builds:
needs: fetch_merge_commit_sha_from_lsp4ij_PR
uses: ./.github/workflows/build-linux.yaml
with:
useLocalPlugin: ${{ inputs.useLocalPlugin || false }}
refLsp4ij: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
lsp4ijBranch: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
refLTITag: ${{ inputs.refLTITag }}
name: Linux Builds
# Call Mac Builds
mac-builds:
needs: fetch_merge_commit_sha_from_lsp4ij_PR
uses: ./.github/workflows/build-mac.yaml
with:
useLocalPlugin: ${{ inputs.useLocalPlugin || false }}
refLsp4ij: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
lsp4ijBranch: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
refLTITag: ${{ inputs.refLTITag }}
name: Mac Builds
# Call Windows Builds
windows-builds:
needs: fetch_merge_commit_sha_from_lsp4ij_PR
uses: ./.github/workflows/build-windows.yaml
with:
useLocalPlugin: ${{ inputs.useLocalPlugin || false }}
refLsp4ij: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
lsp4ijBranch: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
refLTITag: ${{ inputs.refLTITag }}
name: Windows Builds