Skip to content

Commit 58482e2

Browse files
Add Github Actions workflows
1 parent d50f38a commit 58482e2

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
9+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
10+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
11+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Validate Gradle Wrapper
24+
uses: gradle/wrapper-validation-action@v1
25+
26+
- name: Download Java JDK
27+
uses: typelevel/download-java@v2
28+
id: download-java
29+
with:
30+
distribution: temurin
31+
java-version: 11
32+
33+
- name: Setup Java JDK
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: jdkfile
37+
java-version: 11
38+
jdkFile: ${{ steps.download-java.outputs.jdkFile }}
39+
40+
- name: Build & Test
41+
uses: gradle/gradle-build-action@v2
42+
with:
43+
arguments: build --info
44+
45+
- name: Publish Test Results
46+
uses: actions/upload-artifact@v4
47+
if: always()
48+
with:
49+
name: test-results
50+
path: '**/build/test-results/*/TEST-*.xml'
51+
52+
- name: Publish To Sonatype
53+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
54+
uses: gradle/gradle-build-action@v2
55+
with:
56+
arguments: publishAllPublicationsToMavenCentral
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Update Dependency Graph
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
submit:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Validate Gradle Wrapper
22+
uses: gradle/wrapper-validation-action@v1
23+
24+
- name: Download Java JDK
25+
uses: typelevel/download-java@v2
26+
id: download-java
27+
with:
28+
distribution: temurin
29+
java-version: 11
30+
31+
- name: Setup Java JDK
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: jdkfile
35+
java-version: 11
36+
jdkFile: ${{ steps.download-java.outputs.jdkFile }}
37+
38+
- name: Setup Dependency Graph
39+
uses: gradle/gradle-build-action@v2
40+
with:
41+
dependency-graph: generate-and-submit
42+
43+
- name: Generate Dependency Graph Snapshot
44+
uses: gradle/gradle-build-action@v2
45+
env:
46+
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: 'compileClasspath|runtimeClasspath'
47+
with:
48+
arguments: build

.github/workflows/test-report.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test Report
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
checks: write
11+
12+
jobs:
13+
report:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Download Test Report
17+
uses: dawidd6/action-download-artifact@v2
18+
with:
19+
name: test-results
20+
workflow: ${{ github.event.workflow.id }}
21+
run_id: ${{ github.event.workflow_run.id }}
22+
23+
- name: Publish Test Report
24+
uses: mikepenz/action-junit-report@v3
25+
with:
26+
commit: ${{ github.event.workflow_run.head_sha }}
27+
report_paths: "**/build/test-results/*/TEST-*.xml"

0 commit comments

Comments
 (0)