Skip to content

Commit 0ee5931

Browse files
committed
Add workflow to check pull requests in JDT UI that may break JDT-LS.
Signed-off-by: Roland Grunberg <[email protected]>
1 parent a55e324 commit 0ee5931

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Check JDT.UI For Breaking PRs
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
pr-verify-job:
10+
runs-on: ubuntu-latest
11+
env:
12+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
CC_LIST: '@rgrunber'
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
repository: 'eclipse-jdt/eclipse.jdt.ui'
18+
fetch-depth: 2
19+
path: eclipse.jdt.ui
20+
- uses: actions/checkout@v4
21+
with:
22+
repository: 'eclipse-jdtls/eclipse.jdt.ls'
23+
fetch-depth: 2
24+
path: eclipse.jdt.ls
25+
- name: Cache Maven local repository
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/.m2/repository
30+
!~/.m2/repository/org/eclipse/jdt
31+
key: maven-local-${{ hashFiles('eclipse.jdt.ui/pom.xml') }}
32+
- name: Set Up Java
33+
uses: actions/setup-java@v4
34+
with:
35+
java-version: '17'
36+
distribution: 'adopt'
37+
- name: Set up Maven
38+
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5
39+
with:
40+
maven-version: 3.9.4
41+
- name: Check eclipse.jdt.ui PRs
42+
continue-on-error: true
43+
run: |
44+
PRS=`gh --repo=eclipse-jdt/eclipse.jdt.ui pr list --json number | jq .[].number`
45+
set +e
46+
for number in `echo ${PRS}`; do
47+
touchesFiles=`gh --repo=eclipse-jdt/eclipse.jdt.ui pr view ${number} --json files | jq .files[].path | grep 'org.eclipse.jdt.core.manipulation' | wc -l`
48+
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`
49+
if [ "${touchesFiles}" != "0" ] && [ "${alreadyCommented}" == "0" ]; then
50+
pushd eclipse.jdt.ui
51+
git fetch origin pull/${number}/head
52+
git checkout FETCH_HEAD
53+
mvn -B clean install -Pbuild-individual-bundles -pl org.eclipse.jdt.core.manipulation
54+
if [ $? -eq 0 ]; then
55+
popd
56+
pushd eclipse.jdt.ls
57+
mvn -B clean verify -DskipTests
58+
if [ $? -ne 0 ]; then
59+
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."
60+
fi
61+
fi
62+
popd
63+
fi
64+
done
65+
set -e

0 commit comments

Comments
 (0)