-
Notifications
You must be signed in to change notification settings - Fork 14
145 lines (129 loc) · 5.27 KB
/
zxc-compile-pbj-code.yaml
File metadata and controls
145 lines (129 loc) · 5.27 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: "ZXC: Compile"
on:
workflow_call:
inputs:
enable-unit-tests:
description: "Unit Testing Enabled"
type: boolean
required: false
default: false
enable-integration-tests:
description: "Integration Testing Enabled"
type: boolean
required: false
default: false
enable-jmh-tests:
description: "JMH Benchmark Testing Enabled"
type: boolean
required: false
default: false
java-distribution:
description: "Java JDK Distribution:"
type: string
required: false
default: "temurin"
java-version:
description: "Java JDK Version:"
type: string
required: false
default: "21.0.6"
gradle-version:
description: "Gradle Version:"
type: string
required: false
default: "wrapper"
custom-job-label:
description: "Custom Job Label:"
type: string
required: false
default: "Compiles"
secrets:
gradle-cache-username:
description: "The username used to authenticate with the Gradle Build Cache Node."
required: true
gradle-cache-password:
description: "The password used to authenticate with the Gradle Build Cache Node."
required: true
codacy-project-token:
description: "The Codacy project level access token used by the Codacy agent to report an analysis."
required: false
defaults:
run:
shell: bash
permissions:
id-token: write
pull-requests: write
statuses: write
checks: write
issues: read
contents: read
env:
LC_ALL: C.UTF-8
PBJ_CORE: pbj-core
PBJ_INTEGRATION_TESTS: pbj-integration-tests
GRADLE_CACHE_USERNAME: ${{ secrets.gradle-cache-username }}
GRADLE_CACHE_PASSWORD: ${{ secrets.gradle-cache-password }}
jobs:
compile:
name: ${{ inputs.custom-job-label || 'Compiles' }}
runs-on: network-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- name: Checkout Code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
gradle-version: ${{ inputs.gradle-version }}
gradle-home-cache-strict-match: false
- name: Gradle Assemble (PBJ Core)
id: gradle-build
working-directory: ${{ env.PBJ_CORE }}
run: ./gradlew assemble
- name: Gradle Check (PBJ Core)
if: ${{ inputs.enable-unit-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
working-directory: ${{ env.PBJ_CORE }}
run: ./gradlew check
- name: Publish JUnit Test Report (PBJ Core)
uses: step-security/publish-unit-test-result-action@c8537a200a435e2560109a6a8ed9cac838b62656 # v2.20.5
if: ${{ inputs.enable-unit-tests && steps.gradle-build.conclusion == 'success' && !cancelled() && always() }}
with:
check_name: JUnit Test Report
time_unit: seconds
junit_files: "${{ env.PBJ_CORE }}/**/build/test-results/**/*.xml"
# - name: Codacy Coverage Reports
# uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0
# if: ${{ inputs.enable-unit-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
# with:
# project-token: ${{ secrets.codacy-project-token }}
# coverage-reports: ${{ env.PBJ_CORE }}/pbj-compiler/build/reports/jacoco/test/jacocoTestReport.xml, ${{ env.PBJ_CORE }}/pbj-runtime/build/reports/jacoco/test/jacocoTestReport.xml
- name: Gradle Assemble (PBJ Integration)
id: gradle-integration-build
if: ${{ (inputs.enable-integration-tests || inputs.enable-jmh-tests) && !cancelled() }}
working-directory: ${{ env.PBJ_INTEGRATION_TESTS }}
run: ./gradlew assemble
- name: Gradle Check (PBJ Integration)
if: ${{ inputs.enable-integration-tests && steps.gradle-integration-build.conclusion == 'success' && !cancelled() }}
working-directory: ${{ env.PBJ_INTEGRATION_TESTS }}
run: ./gradlew check
- name: Publish Integration Test Report (PBJ Integration)
uses: step-security/publish-unit-test-result-action@c8537a200a435e2560109a6a8ed9cac838b62656 # v2.3.0
if: ${{ inputs.enable-integration-tests && steps.gradle-integration-build.conclusion == 'success' && !cancelled() && always() }}
with:
check_name: Integration Test Report
time_unit: seconds
junit_files: "${{ env.PBJ_INTEGRATION_TESTS }}/**/build/test-results/**/*.xml"
- name: Gradle JMH Benchmarks (PBJ Integration)
if: ${{ inputs.enable-jmh-tests && steps.gradle-integration-build.conclusion == 'success' && !cancelled() && always() }}
working-directory: ${{ env.PBJ_INTEGRATION_TESTS }}
run: ./gradlew jmh