22
22
GRADLE_OPTS : " -XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
23
23
24
24
jobs :
25
- prepare-tests-matrix :
25
+ prepare-matrices :
26
26
runs-on : ubuntu-latest
27
27
# Outputs are used for passing data to dependent jobs.
28
28
outputs :
29
- matrix : ${{ steps.set-matrix.outputs.matrix }}
29
+ framework-tests-matrix : ${{ steps.set-matrices.outputs.framework-tests-matrix }}
30
+ combined-projects-matrix : ${{ steps.set-matrices.outputs.combined-projects-matrix }}
30
31
steps :
31
32
- name : Print environment variables
32
33
run : printenv
@@ -40,24 +41,23 @@ jobs:
40
41
git config --global --add safe.directory ${GITHUB_WORKSPACE}
41
42
git fetch
42
43
git checkout ${{ github.event.inputs.commit_sha }}
43
- - id : set-matrix
44
- name : Read and print config from framework-tests-matrix.json
44
+ - id : set-matrices
45
+ name : Read and print config from framework-tests-matrix.json and combined-projects-matrix.json
45
46
run : |
46
- TASKS=$(echo $(cat .github/workflows/framework-tests-matrix.json))
47
- echo "::set-output name=matrix::$TASKS"
48
- echo $TASKS
49
-
50
- framework-test :
51
- # This job does not need to wait for 'prepare-tests-matrix' result.
52
- # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
53
- # to start execution early.
54
- needs : prepare-tests-matrix
55
- # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
47
+ FRAMEWORK_TESTS=$(echo $(cat .github/workflows/framework-tests-matrix.json))
48
+ COMBINED_PROJECTS=$(echo $(cat .github/workflows/combined-projects-matrix.json))
49
+ echo "::set-output name=framework-tests-matrix::$FRAMEWORK_TESTS"
50
+ echo "::set-output name=combined-projects-matrix::$COMBINED_PROJECTS"
51
+ echo $FRAMEWORK_TESTS
52
+ echo $COMBINED_PROJECTS
53
+ framework-tests :
54
+ needs : prepare-matrices
55
+ # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
56
56
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
57
57
strategy :
58
58
# The option forces to execute all jobs even though some of them have failed.
59
59
fail-fast : false
60
- matrix : ${{ fromJson(needs.prepare-tests-matrix .outputs.matrix) }}
60
+ matrix : ${{ fromJson(needs.prepare-matrices .outputs.framework-tests- matrix) }}
61
61
runs-on : ubuntu-20.04
62
62
container : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
63
63
steps :
@@ -103,16 +103,75 @@ jobs:
103
103
name : test_report ${{ matrix.project.PART_NAME }}
104
104
path : utbot-framework-test/build/reports/tests/test/*
105
105
106
+ combined-projects :
107
+ # This job does not need to wait for 'prepare-tests-matrix' result.
108
+ # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
109
+ # to start execution early.
110
+ needs : prepare-matrices
111
+ # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
112
+ # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
113
+ strategy :
114
+ # The option forces to execute all jobs even though some of them have failed.
115
+ fail-fast : false
116
+ matrix : ${{ fromJson(needs.prepare-matrices.outputs.combined-projects-matrix) }}
117
+ runs-on : ubuntu-20.04
118
+ container : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
119
+ steps :
120
+ - name : Print environment variables
121
+ run : printenv
122
+
123
+ - name : Checkout repository
124
+ uses : actions/checkout@v3
125
+
126
+ - name : Check out ${{ github.event.inputs.commit_sha }} commit
127
+ if : github.event.inputs.commit_sha != ''
128
+ run : |
129
+ git config --global --add safe.directory ${GITHUB_WORKSPACE}
130
+ git fetch
131
+ git checkout ${{ github.event.inputs.commit_sha }}
106
132
107
- project :
108
- needs : prepare-tests-matrix
109
- # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
133
+ - name : Run monitoring
134
+ run : |
135
+ echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
136
+ chmod +x ./scripts/project/monitoring.sh
137
+ ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
138
+ - name : Build project ${{ matrix.projects.first }}
139
+ id : first-project
140
+ run : |
141
+ cd ${{ matrix.projects.first }}
142
+ gradle build --no-daemon
143
+ - name : Build project ${{ matrix.projects.second }}
144
+ if : ${{ steps.first-project.outcome != 'cancelled' && steps.first-project.outcome != 'skipped' }}
145
+ run : |
146
+ cd ${{ matrix.projects.second }}
147
+ gradle build --no-daemon
148
+ - name : Upload test report if tests have failed
149
+ if : ${{ failure() }}
150
+ uses : actions/upload-artifact@v3
151
+ with :
152
+ name : test_report ${{ matrix.projects.first }}
153
+ path : ${{ matrix.projects.first }}/build/reports/tests/test/*
154
+
155
+ - name : Upload test report if tests have failed
156
+ if : ${{ failure() }}
157
+ uses : actions/upload-artifact@v3
158
+ with :
159
+ name : test_report ${{ matrix.projects.second }}
160
+ path : ${{ matrix.projects.second }}/build/reports/tests/test/*
161
+
162
+
163
+ single-project :
164
+ # This job does not need to wait for 'prepare-tests-matrix' result.
165
+ # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
166
+ # to start execution early.
167
+ needs : prepare-matrices
168
+ # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
110
169
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
111
170
strategy :
112
171
# The option forces to execute all jobs even though some of them have failed.
113
172
fail-fast : false
114
173
matrix :
115
- project : [utbot-api, utbot-cli, utbot- core, utbot-framework, utbot-framework-api, utbot- fuzzers, utbot-gradle, utbot-instrumentation, utbot-instrumentation-tests, utbot-intellij, utbot- junit-contest, utbot-rd, utbot- sample, utbot-summary, utbot-summary-tests ]
174
+ project : [utbot-core, utbot-fuzzers, utbot-gradle, utbot-junit-contest, utbot-sample]
116
175
runs-on : ubuntu-20.04
117
176
container : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
118
177
steps :
0 commit comments