forked from MCreator/MCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.78 KB
/
test.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
name: Build and test
on:
push:
branches:
- master
- "feature/*"
- "dev/*"
pull_request:
branches:
- master
- "feature/*"
- "dev/*"
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17.0.10+7'
distribution: 'temurin'
- name: Cache Gradle Packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.mcreator/gradle/caches/
~/.mcreator/gradle/wrapper/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build and Test Using Gradle
run: xvfb-run -a ./gradlew test
- name: Test Javadoc Generation
run: ./gradlew javadoc
- name: Publish Test Report
uses: mikepenz/action-junit-report@b1b7f659602565970688b2e2588738b9398e895d
if: always() # always run even if the previous step fails
with:
include_passed: true
detailed_summary: true
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Prepare Gradle Cache
run: |
rm -f ~/.mcreator/gradle/caches/modules-2/modules-2.lock
rm -fr ~/.mcreator/gradle/caches/*/plugin-resolution/
rm -f ~/.mcreator/gradle/caches/minecraft/deobfedDeps/providedDummy.jar
rm -f ~/.mcreator/gradle/caches/minecraft/deobfedDeps/compileDummy.jar
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties