-
Notifications
You must be signed in to change notification settings - Fork 30
103 lines (90 loc) · 2.44 KB
/
build-test.yml
File metadata and controls
103 lines (90 loc) · 2.44 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build & Test
on:
pull_request:
paths-ignore:
- ".github/**"
- ".gitignore"
- "LICENSE"
- "README.md"
- "CODE_OF_CONDUCT.md"
- "CONTRIBUTING.md"
push:
paths-ignore:
- ".github/**"
- ".gitignore"
- "LICENSE"
- "README.md"
- "CODE_OF_CONDUCT.md"
- "CONTRIBUTING.md"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up GraalVM JDK 21
uses: actions/setup-java@v4
with:
distribution: graalvm
java-version: 21
cache: gradle
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Run Tests with Gradle
run: ./gradlew test --no-daemon --stacktrace
- name: Report test results
uses: dorny/test-reporter@v2
if: always()
with:
name: Gradle Tests
path: build/test-results/test/*.xml
reporter: java-junit
fail-on-error: true
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up GraalVM JDK 21
uses: actions/setup-java@v4
with:
distribution: graalvm
java-version: 21
cache: gradle
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with snapshot version
env:
SNAPSHOT: true
GITHUB_SHA: ${{ github.sha }}
run: ./gradlew jar --no-daemon --stacktrace
- name: Upload Plugin JAR
uses: actions/upload-artifact@v4
with:
name: OpenMC-${{ github.sha }}
path: builds/