@@ -6,14 +6,6 @@ description: |
6
6
This actions will also annotate the PR or commit with the failed tests.
7
7
8
8
inputs :
9
- execution-only-caches :
10
- description : |
11
- Activates only the caches that are relevant for executing gradle command.
12
- This is helpful when build job executes multiple gradle commands sequentially.
13
- Then the caching is implemented in the very first one, and the subsequent should be marked
14
- with execution-only-caches: true
15
- required : false
16
- default : ' false'
17
9
gradle-properties :
18
10
description : Content of a gradle.properties file that will be passed to the gradle runner.
19
11
required : false
@@ -23,12 +15,10 @@ inputs:
23
15
Defaults to the root project.
24
16
required : true
25
17
default : " ."
26
- gradle-dependencies -cache-key :
27
- description : Extra files to take into account for ~/.gradle/caches dependencies
18
+ read-only -cache :
19
+ description : If set to true, the action will only read from the cache and will not write to it.
28
20
required : true
29
- default : |
30
- buildSrc/**/Dependencies.kt
31
- gradle/libs.versions.toml
21
+ default : " true"
32
22
report-retention-days :
33
23
description : Duration in days to preserve reports.
34
24
required : true
@@ -66,15 +56,32 @@ runs:
66
56
fi
67
57
echo "artifact-path=$ARTIFACT_PATH" >> $GITHUB_OUTPUT
68
58
59
+ - name : Process gradle properties
60
+ id : gradle-properties
61
+ shell : python
62
+ env :
63
+ GRADLE_PROPERTIES : ${{ inputs.gradle-properties }}
64
+ run : |
65
+ import os
66
+
67
+ properties_list: list[str] = [line for line in (line.strip() for line in os.environ.get('GRADLE_PROPERTIES').splitlines()) if line]
68
+ properties = list(map(lambda x: f'-P{x}' if not x.startswith('-P') else x, properties_list))
69
+
70
+ with open(os.environ.get('GITHUB_OUTPUT'), 'a') as output_file:
71
+ output_file.write('gradle-properties=')
72
+ output_file.write(' '.join(properties))
73
+ output_file.write('\n')
74
+
69
75
- name : Run tests
70
- uses : burrunan /gradle-cache -action@v1
76
+ uses : gradle /gradle-build -action@v2
71
77
with :
72
78
gradle-version : wrapper
73
79
build-root-directory : ${{ inputs.working-directory }}
74
- gradle-dependencies-cache-key : ${{ inputs.gradle-dependencies-cache-key }}
75
- arguments : -p ${{ inputs.gradle-project-path }} ci-${{ inputs.task-name }}
76
- properties : ${{ inputs.gradle-properties }}
77
- execution-only-caches : ${{ inputs.execution-only-caches }}
80
+ cache-read-only : ${{ inputs.read-only-cache }}
81
+ arguments : |
82
+ -p ${{ inputs.gradle-project-path }}
83
+ ci-${{ inputs.task-name }}
84
+ ${{ steps.gradle-properties.outputs.gradle-properties }}
78
85
79
86
- name : Upload report
80
87
uses : actions/upload-artifact@v3
0 commit comments