Skip to content

Commit

Permalink
Add workflow to check pull requests in JDT UI that may break JDT-LS.
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed Feb 9, 2024
1 parent a55e324 commit 0ee5931
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/check-breaking-prs.yml
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

0 comments on commit 0ee5931

Please sign in to comment.