@@ -21,14 +21,31 @@ jobs:
21
21
java-version : ' 8'
22
22
distribution : ' zulu'
23
23
java-package : jdk+fx
24
+
24
25
- uses : gradle/gradle-build-action@v2
25
26
with :
26
27
gradle-version : 6.8
28
+
29
+ - name : Set project version
30
+ run : echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
27
31
28
32
- name : Build and run tests in UTBot Java
29
33
run : |
30
34
export KOTLIN_HOME="/usr"
31
- gradle clean build --no-daemon
35
+ gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}
36
+
37
+ - name : Publish Test Results
38
+ uses : EnricoMi/publish-unit-test-result-action@v1
39
+ if : always()
40
+ with :
41
+ files : " **/build/test-results/**/*.xml"
42
+
43
+ - name : Cache utbot-cli-${{ env.VERSION }}.jar
44
+ if : ${{ github.event_name != 'pull_request' }}
45
+ uses : actions/cache@v3
46
+ with :
47
+ path : utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar
48
+ key : utbot-cli
32
49
33
50
- name : Upload utbot-framework logs
34
51
if : ${{ always() }}
@@ -44,12 +61,13 @@ jobs:
44
61
name : utbot_framework_tests_report
45
62
path : utbot-framework/build/reports/tests/test/*
46
63
47
- - name : Upload utbot-intellij tests report artifacts if tests have failed
48
- if : ${{ failure() }}
49
- uses : actions/upload-artifact@v2
50
- with :
51
- name : utbot_intellij_tests_report
52
- path : utbot-intellij/build/reports/tests/test/*
64
+
65
+ publish_cli_image :
66
+ needs : build_and_run_tests
67
+ if : ${{ github.event_name != 'pull_request' }}
68
+ runs-on : ubuntu-20.04
69
+ steps :
70
+ - uses : actions/checkout@v2
53
71
54
72
- name : Set timezone
55
73
uses : szenius/set-timezone@v1.0
60
78
run : |
61
79
echo "COMMIT_SHORT_SHA="$(git rev-parse --short HEAD)"" >> $GITHUB_ENV
62
80
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
81
+
82
+ - uses : actions/cache@v3
83
+ with :
84
+ path : utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar
85
+ key : utbot-cli
86
+
63
87
- name : Set docker tag
64
88
run :
65
89
echo "DOCKER_TAG="$(date +%Y).$(date +%-m).$(date +%-d)-${{ env.COMMIT_SHORT_SHA }}"" >> $GITHUB_ENV
@@ -81,13 +105,15 @@ jobs:
81
105
key : ${{ runner.os }}-buildx-${{ github.sha }}
82
106
restore-keys : |
83
107
${{ runner.os }}-buildx-
108
+
84
109
- name : Docker meta
85
110
id : meta
86
111
uses : docker/metadata-action@v3
87
112
with :
88
113
images : ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
89
114
tags : |
90
115
type=raw,value=${{ env.DOCKER_TAG }}
116
+
91
117
- name : Docker Buildx (build and push)
92
118
run : |
93
119
docker buildx build \
@@ -100,6 +126,7 @@ jobs:
100
126
# Temp fix
101
127
# https://github.com/docker/build-push-action/issues/252
102
128
# https://github.com/moby/buildkit/issues/1896
129
+
103
130
- name : Move cache
104
131
run : |
105
132
rm -rf /tmp/.buildx-cache
0 commit comments