Skip to content

Commit 4de3a4c

Browse files
committed
fiw workflow loading test
1 parent a677f27 commit 4de3a4c

File tree

1 file changed

+56
-70
lines changed

1 file changed

+56
-70
lines changed

.github/workflows/build-feature.yml

Lines changed: 56 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
# Checkout the code from the repository
3636
- name: Checkout
37-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
3838
with:
3939
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
4040

@@ -47,15 +47,15 @@ jobs:
4747

4848
# Cache Sonar packages to speed up the build process
4949
- name: Cache SonarCloud packages
50-
uses: actions/cache@v3
50+
uses: actions/cache@v4
5151
with:
5252
path: ~/.sonar/cache
5353
key: ${{ runner.os }}-sonar
5454
restore-keys: ${{ runner.os }}-sonar
5555

5656
# Cache Maven packages to speed up the build process
5757
- name: Cache Maven packages
58-
uses: actions/cache@v3
58+
uses: actions/cache@v4
5959
with:
6060
path: ~/.m2/repository
6161
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -116,7 +116,7 @@ jobs:
116116
steps:
117117
# Checkout the code from the repository
118118
- name: Checkout
119-
uses: actions/checkout@v3
119+
uses: actions/checkout@v4
120120
with:
121121
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
122122

@@ -129,7 +129,7 @@ jobs:
129129

130130
# Cache Maven packages to speed up the build process
131131
- name: Cache Maven packages
132-
uses: actions/cache@v3
132+
uses: actions/cache@v4
133133
with:
134134
path: ~/.m2/repository
135135
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -144,13 +144,13 @@ jobs:
144144
# Create a "doc" directory and move karate reports to it
145145
- name: Get report
146146
run: |
147-
mkdir -p doc
148-
mv ./nrt/target/karate-reports/* ./doc
147+
mkdir -p doc/karate
148+
mv ./nrt/target/karate-reports/* ./doc/karate
149149
150-
- uses: actions/upload-artifact@master
150+
- uses: actions/upload-artifact@v4
151151
with:
152152
name: karate
153-
path: doc/karate
153+
path: ./doc/karate/
154154
# - name: Upload artifact
155155
# uses: actions/upload-pages-artifact@v1
156156
# with:
@@ -170,7 +170,7 @@ jobs:
170170
steps:
171171
# Checkout the code from the repository
172172
- name: Checkout
173-
uses: actions/checkout@v3
173+
uses: actions/checkout@v4
174174

175175
- name: Set up JDK 21
176176
uses: actions/setup-java@v4
@@ -192,65 +192,51 @@ jobs:
192192
.github/scripts/extract_and_generate_html.sh
193193
shell: bash
194194

195-
- uses: actions/upload-artifact@master
195+
- uses: actions/upload-artifact@v4
196196
with:
197197
name: gatling
198198
path: doc/gatling
199199

200-
# - name: Upload artifact
201-
# uses: actions/upload-pages-artifact@v1
202-
# with:
203-
# # Upload entire repository
204-
# path: './doc'
205-
# - name: Deploy to GitHub Pages
206-
# id: deployment
207-
# uses: actions/deploy-pages@v1
208-
209-
# - name: Generate Job Summary
210-
# uses: actions/github-script@v6
211-
# with:
212-
# script: |
213-
# const fs = require('fs')
214-
# const lastRuns = fs.readFileSync(`loading/target/gatling/lastRun.txt`).toString().trim().split('\n');
215-
#
216-
# for(const run of lastRuns) {
217-
# const formattedLine = run.replace(/(.*)-(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, ' $1 at $2-$3-$4 $5:$6:$7');
218-
# const results = JSON.parse(fs.readFileSync(`loading/target/gatling/${run}/js/stats.json`).toString());
219-
# let tableContent = [
220-
# [
221-
# {data: 'Request', header: true},
222-
# {data: 'Success ✅', header: true},
223-
# {data: 'Errors ❌', header: true},
224-
# {data: 'Min', header: true},
225-
# {data: 'Max', header: true},
226-
# {data: 'Avg.', header: true},
227-
# {data: 'Std. Dev.', header: true},
228-
# {data: 'RPS', header: true},
229-
# ]
230-
# ];
231-
#
232-
# for(const result in results.contents) {
233-
# const requestMetrics = results.contents[result].stats;
234-
# tableContent.push([
235-
# requestMetrics.name,
236-
# requestMetrics.numberOfRequests.ok.toString(),
237-
# requestMetrics.numberOfRequests.ko.toString(),
238-
# requestMetrics.minResponseTime.total.toString(),
239-
# requestMetrics.maxResponseTime.total.toString(),
240-
# requestMetrics.meanResponseTime.total.toString(),
241-
# requestMetrics.standardDeviation.total.toString(),
242-
# requestMetrics.meanNumberOfRequestsPerSecond.total.toString(),
243-
# ]);
244-
# }
245-
#
246-
# await core.summary
247-
# .addHeading(`Results for ${formattedLine}`)
248-
# .addTable(tableContent)
249-
# .addQuote('All times are in millisecond (ms). RPS means "Requests per Second"')
250-
# .write()
251-
# }
252-
#
253-
200+
- name: Generate Job Summary
201+
uses: actions/github-script@v7
202+
with:
203+
script: |
204+
const fs = require('fs')
205+
const lastRuns = fs.readFileSync(`loading/target/gatling/lastRun.txt`).toString().trim().split('\n');
206+
for(const run of lastRuns) {
207+
const formattedLine = run.replace(/(.*)-(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, ' $1 at $2-$3-$4 $5:$6:$7');
208+
const results = JSON.parse(fs.readFileSync(`loading/target/gatling/${run}/js/stats.json`).toString());
209+
let tableContent = [
210+
[
211+
{data: 'Request', header: true},
212+
{data: 'Success ✅', header: true},
213+
{data: 'Errors ❌', header: true},
214+
{data: 'Min', header: true},
215+
{data: 'Max', header: true},
216+
{data: 'Avg.', header: true},
217+
{data: 'Std. Dev.', header: true},
218+
{data: 'RPS', header: true},
219+
]
220+
];
221+
for(const result in results.contents) {
222+
const requestMetrics = results.contents[result].stats;
223+
tableContent.push([
224+
requestMetrics.name,
225+
requestMetrics.numberOfRequests.ok.toString(),
226+
requestMetrics.numberOfRequests.ko.toString(),
227+
requestMetrics.minResponseTime.total.toString(),
228+
requestMetrics.maxResponseTime.total.toString(),
229+
requestMetrics.meanResponseTime.total.toString(),
230+
requestMetrics.standardDeviation.total.toString(),
231+
requestMetrics.meanNumberOfRequestsPerSecond.total.toString(),
232+
]);
233+
}
234+
await core.summary
235+
.addHeading(`Results for ${formattedLine}`)
236+
.addTable(tableContent)
237+
.addQuote('All times are in millisecond (ms). RPS means "Requests per Second"')
238+
.write()
239+
}
254240
deploy_reports:
255241
name: Deploy Reports
256242
needs:
@@ -259,16 +245,16 @@ jobs:
259245
runs-on: ubuntu-latest
260246
steps:
261247
- name: Checkout
262-
uses: actions/checkout@v3
248+
uses: actions/checkout@v4
263249

264250
- name: Retrieve saved Non Regression Test
265-
uses: actions/download-artifact@v3
251+
uses: actions/download-artifact@v4
266252
with:
267253
name: karate
268-
path: doc/karate
254+
path: ./doc/karate
269255

270256
- name: Retrieve saved Loading Test
271-
uses: actions/download-artifact@v3
257+
uses: actions/download-artifact@v4
272258
with:
273259
name: gatling
274260
path: doc/gatling
@@ -280,7 +266,7 @@ jobs:
280266
path: './doc'
281267
- name: Deploy to GitHub Pages
282268
id: deployment
283-
uses: actions/deploy-pages@v1
269+
uses: actions/deploy-pages@v4
284270

285271
- name: Echo URL Reports
286272
run: |

0 commit comments

Comments
 (0)