Skip to content

Commit 8819942

Browse files
committed
Merge branch 'master' of https://github.com/WebFuzzing/EvoMaster into vw-delete-graph
2 parents a1a9f88 + b3c6ca5 commit 8819942

7,024 files changed

Lines changed: 43776 additions & 9174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Full Build Metrics
2+
description: Count Maven warnings/errors, compare against latest successful baseline, and persist current metrics artifact
3+
4+
inputs:
5+
log-file:
6+
description: Path to the captured build log
7+
required: false
8+
default: full-build-base.log
9+
artifact-name:
10+
description: Artifact name used to store metrics
11+
required: false
12+
default: full-build-base-metrics
13+
baseline-branch:
14+
description: Branch to fetch the latest successful baseline metrics from
15+
required: false
16+
default: master
17+
workflow-file:
18+
description: Workflow filename to query for baseline artifacts
19+
required: false
20+
default: ci.yml
21+
retention-days:
22+
description: Artifact retention period in days
23+
required: false
24+
default: "90"
25+
26+
runs:
27+
using: composite
28+
steps:
29+
- name: Download previous metrics artifact
30+
uses: dawidd6/action-download-artifact@v20
31+
with:
32+
workflow: ${{ inputs.workflow-file }}
33+
workflow_conclusion: success
34+
branch: ${{ inputs.baseline-branch }}
35+
name: ${{ inputs.artifact-name }}
36+
path: previous-metrics
37+
if_no_artifact_found: warn
38+
39+
- name: Count warnings/errors and compare
40+
shell: bash
41+
run: |
42+
if [ -f "${{ inputs.log-file }}" ]; then
43+
warnings_count=$(grep -c "^\[WARNING\]" "${{ inputs.log-file }}" || true)
44+
errors_count=$(grep -c "^\[ERROR\]" "${{ inputs.log-file }}" || true)
45+
else
46+
warnings_count=9999999
47+
errors_count=9999999
48+
fi
49+
50+
previous_warnings=""
51+
previous_errors=""
52+
if [ -f previous-metrics/build-metrics.env ]; then
53+
# shellcheck disable=SC1091
54+
. previous-metrics/build-metrics.env
55+
previous_warnings="${WARNINGS:-}"
56+
previous_errors="${ERRORS:-}"
57+
fi
58+
59+
echo "full-build-base warnings: ${warnings_count}"
60+
echo "full-build-base errors: ${errors_count}"
61+
62+
regression=false
63+
if [ -n "${previous_warnings}" ] && [ -n "${previous_errors}" ]; then
64+
warnings_delta=$((warnings_count - previous_warnings))
65+
errors_delta=$((errors_count - previous_errors))
66+
echo "delta warnings vs last successful ${{ inputs.baseline-branch }} run: ${warnings_delta}"
67+
echo "delta errors vs last successful ${{ inputs.baseline-branch }} run: ${errors_delta}"
68+
if [ "${warnings_count}" -le "${previous_warnings}" ] && [ "${errors_count}" -le "${previous_errors}" ]; then
69+
echo "Result: green (no increase in warnings or errors)."
70+
else
71+
echo "Result: yellow (warnings or errors increased)."
72+
regression=true
73+
fi
74+
else
75+
echo "No previous metrics artifact found on ${{ inputs.baseline-branch }} for comparison."
76+
echo "Result: green (no baseline available)."
77+
fi
78+
79+
printf "WARNINGS=%s\nERRORS=%s\n" "${warnings_count}" "${errors_count}" > build-metrics.env
80+
81+
{
82+
echo "full-build-base warnings: ${warnings_count}"
83+
echo "full-build-base errors: ${errors_count}"
84+
if [ -n "${previous_warnings}" ] && [ -n "${previous_errors}" ]; then
85+
echo "delta warnings vs last successful ${{ inputs.baseline-branch }} run: ${warnings_delta}"
86+
echo "delta errors vs last successful ${{ inputs.baseline-branch }} run: ${errors_delta}"
87+
else
88+
echo "No previous metrics artifact found on ${{ inputs.baseline-branch }} for comparison."
89+
fi
90+
} >> "$GITHUB_STEP_SUMMARY"
91+
92+
if [ "${regression}" = "true" ]; then
93+
echo "METRICS_REGRESSION=true" >> "$GITHUB_ENV"
94+
else
95+
echo "METRICS_REGRESSION=false" >> "$GITHUB_ENV"
96+
fi
97+
98+
- name: Upload current metrics artifact
99+
uses: actions/upload-artifact@v7
100+
with:
101+
name: ${{ inputs.artifact-name }}
102+
path: build-metrics.env
103+
retention-days: ${{ inputs.retention-days }}
104+
if-no-files-found: error
105+
106+
- name: Mark metrics regression
107+
if: ${{ env.METRICS_REGRESSION == 'true' }}
108+
shell: bash
109+
run: exit 1

0 commit comments

Comments
 (0)