-
-
Notifications
You must be signed in to change notification settings - Fork 179
61 lines (49 loc) · 1.67 KB
/
build-prs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/build-prs.yml
name: Build PRs
on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
push:
branches:
- 'feature/**'
workflow_dispatch:
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: Validate wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
- name: Setup with Gradle
run: ./gradlew :neoforge:setup -PvalidateAccessTransformers
- name: Build with Gradle
run: ./gradlew assemble checkFormatting
- name: Run JCC
run: ./gradlew checkJarCompatibility
- name: Upload JCC
uses: neoforged/action-jar-compatibility/upload@v1
- name: Publish artifacts
uses: neoforged/action-pr-publishing/upload@v1