Skip to content

Commit 79b5286

Browse files
committed
Improve CI
1 parent 32f01ff commit 79b5286

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/build_and_publish.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build and Publish
2-
on: [push, pull_request, workflow_dispatch]
2+
on: push
33
jobs:
44
build:
55
runs-on: ubuntu-latest
@@ -21,7 +21,8 @@
2121
- name: Test
2222
run: ./gradlew test check
2323

24-
- name: Sonar
24+
- if: github.repository == 'FabricCompatibilityLayers/Mod-Remapping-API'
25+
name: Sonar
2526
run: ./gradlew jacocoTestCoverageVerification jacocoTestReport sonar
2627
env:
2728
SONAR_URL: ${{ secrets.SONAR_URL }}

.github/workflows/pull_request.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build and Publish
2+
on: [pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Validate Gradle Wrapper
9+
uses: gradle/wrapper-validation-action@v3
10+
- name: Set up JDK 17
11+
uses: actions/setup-java@v4
12+
with:
13+
java-version: 17
14+
distribution: temurin
15+
16+
- name: Build
17+
run: ./gradlew build -x test
18+
19+
- name: Test
20+
run: ./gradlew test check
21+
22+
- name: Store reports if any
23+
if: failure()
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: reports
27+
path: |
28+
**/build/reports/
29+
**/build/test-results/

0 commit comments

Comments
 (0)