File tree Expand file tree Collapse file tree 2 files changed +107
-0
lines changed
Expand file tree Collapse file tree 2 files changed +107
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Gradle Task
2+ run-name : " Gradle Task ${{ inputs.gradle-task }} @ ${{ inputs.runs-on }}"
3+
4+ # Reusable Workflow for running a Gradle task
5+
6+ on :
7+ workflow_dispatch :
8+
9+ workflow_call :
10+ inputs :
11+ gradle-task :
12+ description : " The Gradle task to run, including any flags"
13+ required : true
14+ type : string
15+ runs-on :
16+ description : " OSes to run the task on"
17+ required : true
18+ type : string
19+
20+
21+ concurrency :
22+ # note: the Workflow inputs are also included in the concurrency group
23+ group : " ${{ github.workflow }} ${{ join(inputs.*) }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
24+ cancel-in-progress : true
25+
26+
27+ permissions :
28+ contents : read
29+ checks : write # required by mikepenz/action-junit-report
30+
31+ jobs :
32+
33+ run-task :
34+ runs-on : ${{ inputs.runs-on }}
35+ name : " ./gradlew ${{ inputs.gradle-task}} @ ${{ inputs.runs-on }}"
36+ timeout-minutes : 60
37+ steps :
38+
39+ # ## Gradle task ###
40+
41+ - name : Checkout the repo
42+ uses : actions/checkout@v3
43+
44+ - name : Setup JDK
45+ uses : actions/setup-java@v3
46+ with :
47+ distribution : temurin
48+ java-version : 11
49+
50+ - uses : gradle/gradle-build-action@v2
51+ with :
52+ gradle-home-cache-cleanup : true
53+ arguments : ${{ inputs.gradle-task }}
54+
55+ - name : Upload build reports
56+ if : failure()
57+ uses : actions/upload-artifact@v3
58+ with :
59+ name : build-report-${{ runner.os }}${{ github.action }}
60+ path : |
61+ **/build/reports/
62+ **/*.hprof
63+ **/*.log
64+ if-no-files-found : ignore
65+
66+ - name : Publish Test Reports
67+ uses : mikepenz/action-junit-report@v3
68+ if : always()
69+ with :
70+ report_paths : |
71+ **/build/test-results/**/TEST-*.xml
72+ require_tests : false
Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on :
4+ pull_request :
5+ workflow_dispatch :
6+ workflow_call :
7+ push :
8+ branches :
9+ - main
10+
11+
12+ concurrency :
13+ group : " ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
14+ cancel-in-progress : true
15+
16+
17+ permissions :
18+ contents : read
19+ checks : write # required by mikepenz/action-junit-report
20+
21+
22+ jobs :
23+
24+ gradle-check :
25+ strategy :
26+ matrix :
27+ os : [ macos-latest, ubuntu-latest, windows-latest ]
28+ task :
29+ - check --continue
30+ fail-fast : false
31+ uses : ./.github/workflows/gradle_task.yml
32+ with :
33+ runs-on : ${{ matrix.os }}
34+ gradle-task : >-
35+ ${{ matrix.task }} --stacktrace
You can’t perform that action at this time.
0 commit comments