From 86d5a455acf59bf4e06c8bd6fb899e7fe56f1be1 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:20:07 +0100 Subject: [PATCH] Implement GHA PR checks --- .github/workflows/build-prs.yml | 51 +++++++++++++++++++ .github/workflows/comments.yml | 16 ------ .github/workflows/issues.yml | 16 ------ .github/workflows/pull_request_review.yml | 13 ----- .../workflows/pull_request_review_comment.yml | 13 ----- .../pull_request_review_comment_run.yml | 20 -------- .github/workflows/pull_request_review_run.yml | 20 -------- .github/workflows/pull_requests.yml | 18 ------- .github/workflows/push.yml | 16 ------ 9 files changed, 51 insertions(+), 132 deletions(-) create mode 100644 .github/workflows/build-prs.yml delete mode 100644 .github/workflows/comments.yml delete mode 100644 .github/workflows/issues.yml delete mode 100644 .github/workflows/pull_request_review.yml delete mode 100644 .github/workflows/pull_request_review_comment.yml delete mode 100644 .github/workflows/pull_request_review_comment_run.yml delete mode 100644 .github/workflows/pull_request_review_run.yml delete mode 100644 .github/workflows/pull_requests.yml delete mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml new file mode 100644 index 0000000000..54241536dc --- /dev/null +++ b/.github/workflows/build-prs.yml @@ -0,0 +1,51 @@ +name: Build and test PRs + +on: + pull_request: + types: + - synchronize + - opened + - ready_for_review + - reopened + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1000 + fetch-tags: true + + # GradleUtils will append the branch name to the version, + # but for that we need a properly checked out branch + - name: Create branch for commit + run: + git switch -C pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.ref }} + + - name: Setup JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: setup + + - name: Build with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: build + + - name: Checks ATs, patches, etc... + uses: gradle/gradle-build-action@v2 + with: + arguments: checkAll + + - name: Checks JAR compatibility + uses: gradle/gradle-build-action@v2 + with: + arguments: checkJarCompatibility diff --git a/.github/workflows/comments.yml b/.github/workflows/comments.yml deleted file mode 100644 index 721653a26d..0000000000 --- a/.github/workflows/comments.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Comment actions' - -on: issue_comment - -permissions: - contents: read - issues: write - pull-requests: write - discussions: write - -jobs: - labels: - uses: MinecraftForge/SharedActions/.github/workflows/comment_actions.yml@main - secrets: - GH_APP_KEY: ${{ secrets.GH_APP_KEY }} - GH_APP_NAME: ${{ secrets.GH_APP_NAME }} \ No newline at end of file diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml deleted file mode 100644 index b141d9938e..0000000000 --- a/.github/workflows/issues.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Issue actions' - -on: issues - -permissions: - contents: read - issues: write - pull-requests: write - discussions: write - -jobs: - labels: - uses: MinecraftForge/SharedActions/.github/workflows/issue_actions.yml@main - secrets: - GH_APP_KEY: ${{ secrets.GH_APP_KEY }} - GH_APP_NAME: ${{ secrets.GH_APP_NAME }} \ No newline at end of file diff --git a/.github/workflows/pull_request_review.yml b/.github/workflows/pull_request_review.yml deleted file mode 100644 index 7f44cbdb09..0000000000 --- a/.github/workflows/pull_request_review.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'PR Review' - -on: pull_request_review - -jobs: - upload_payload: - name: Upload payload - runs-on: ubuntu-latest - steps: - - uses: actions/upload-artifact@v3 # Payload artifact is consumed in Actionable - with: - name: payload - path: ${{ github.event_path }} \ No newline at end of file diff --git a/.github/workflows/pull_request_review_comment.yml b/.github/workflows/pull_request_review_comment.yml deleted file mode 100644 index 2c3e5bc54b..0000000000 --- a/.github/workflows/pull_request_review_comment.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'PR Review Comment' - -on: pull_request_review_comment - -jobs: - upload_payload: - name: Upload payload - runs-on: ubuntu-latest - steps: - - uses: actions/upload-artifact@v3 # Payload artifact is consumed in Actionable - with: - name: payload - path: ${{ github.event_path }} \ No newline at end of file diff --git a/.github/workflows/pull_request_review_comment_run.yml b/.github/workflows/pull_request_review_comment_run.yml deleted file mode 100644 index a2e8f66d5c..0000000000 --- a/.github/workflows/pull_request_review_comment_run.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Pull Request Review Comment actions' - -on: - workflow_run: - workflows: [PR Review Comment] - types: - - completed - -permissions: - contents: read - issues: write - pull-requests: write - discussions: write - -jobs: - labels: - uses: MinecraftForge/SharedActions/.github/workflows/pr_review_comment_actions.yml@main - secrets: - GH_APP_KEY: ${{ secrets.GH_APP_KEY }} - GH_APP_NAME: ${{ secrets.GH_APP_NAME }} \ No newline at end of file diff --git a/.github/workflows/pull_request_review_run.yml b/.github/workflows/pull_request_review_run.yml deleted file mode 100644 index 8860c782f8..0000000000 --- a/.github/workflows/pull_request_review_run.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Pull Request Review actions' - -on: - workflow_run: - workflows: [PR Review] - types: - - completed - -permissions: - contents: read - issues: write - pull-requests: write - discussions: write - -jobs: - labels: - uses: MinecraftForge/SharedActions/.github/workflows/pr_review_actions.yml@main - secrets: - GH_APP_KEY: ${{ secrets.GH_APP_KEY }} - GH_APP_NAME: ${{ secrets.GH_APP_NAME }} \ No newline at end of file diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml deleted file mode 100644 index 80ac5ea74e..0000000000 --- a/.github/workflows/pull_requests.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'Pull Request actions' - -on: - pull_request_target: - types: [assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, synchronize, converted_to_draft, ready_for_review, locked, unlocked, review_requested, review_request_removed, auto_merge_enabled, auto_merge_disabled] - -permissions: - contents: read - issues: write - pull-requests: write - discussions: write - -jobs: - labels: - uses: MinecraftForge/SharedActions/.github/workflows/pr_actions.yml@main - secrets: - GH_APP_KEY: ${{ secrets.GH_APP_KEY }} - GH_APP_NAME: ${{ secrets.GH_APP_NAME }} \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index b71c8499c9..0000000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Push actions' - -on: push - -permissions: - contents: read - issues: write - pull-requests: write - discussions: write - -jobs: - labels: - uses: MinecraftForge/SharedActions/.github/workflows/push_actions.yml@main - secrets: - GH_APP_KEY: ${{ secrets.GH_APP_KEY }} - GH_APP_NAME: ${{ secrets.GH_APP_NAME }} \ No newline at end of file