forked from eclipse-jdtls/eclipse.jdt.ls
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to check pull requests in JDT UI that may break JDT-LS.
Signed-off-by: Roland Grunberg <[email protected]>
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Check JDT.UI For Breaking PRs | ||
|
||
on: | ||
schedule: | ||
- cron: '0 8 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pr-verify-job: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CC_LIST: '@rgrunber' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 'eclipse-jdt/eclipse.jdt.ui' | ||
fetch-depth: 2 | ||
path: eclipse.jdt.ui | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 'eclipse-jdtls/eclipse.jdt.ls' | ||
fetch-depth: 2 | ||
path: eclipse.jdt.ls | ||
- name: Cache Maven local repository | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
!~/.m2/repository/org/eclipse/jdt | ||
key: maven-local-${{ hashFiles('eclipse.jdt.ui/pom.xml') }} | ||
- name: Set Up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5 | ||
with: | ||
maven-version: 3.9.4 | ||
- name: Check eclipse.jdt.ui PRs | ||
continue-on-error: true | ||
run: | | ||
PRS=`gh --repo=eclipse-jdt/eclipse.jdt.ui pr list --json number | jq .[].number` | ||
set +e | ||
for number in `echo ${PRS}`; do | ||
touchesFiles=`gh --repo=eclipse-jdt/eclipse.jdt.ui pr view ${number} --json files | jq .files[].path | grep 'org.eclipse.jdt.core.manipulation' | wc -l` | ||
alreadyCommented=`gh --repo=eclipse-jdt/eclipse.jdt.ui pr view ${number} --json comments | jq -r .comments[].body | grep 'eclipse-jdtls/eclipse.jdt.ls' | wc -l` | ||
if [ "${touchesFiles}" != "0" ] && [ "${alreadyCommented}" == "0" ]; then | ||
pushd eclipse.jdt.ui | ||
git fetch origin pull/${number}/head | ||
git checkout FETCH_HEAD | ||
mvn -B clean install -Pbuild-individual-bundles -pl org.eclipse.jdt.core.manipulation | ||
if [ $? -eq 0 ]; then | ||
popd | ||
pushd eclipse.jdt.ls | ||
mvn -B clean verify -DskipTests | ||
if [ $? -ne 0 ]; then | ||
gh --repo=eclipse-jdt/eclipse.jdt.ui pr comment ${number} --body="This pull request may break the eclipse-jdtls/eclipse.jdt.ls project. CC'ing ${{ env.CC_LIST }} for awareness." | ||
fi | ||
fi | ||
popd | ||
fi | ||
done | ||
set -e |