-
Notifications
You must be signed in to change notification settings - Fork 8
178 lines (151 loc) · 4.88 KB
/
GnuTests.yml
File metadata and controls
178 lines (151 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: GnuTests
on:
pull_request:
push:
branches:
- '*'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
TEST_FULL_SUMMARY_FILE: 'gnu-full-result.json'
TEST_SUMMARY_FILE: 'gnu-result.json'
AGGREGATED_SUMMARY_FILE: 'aggregated-result.json'
jobs:
native:
name: Run GNU tests (native)
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- name: Checkout code (uutils)
uses: actions/checkout@v4
with:
path: 'uutils'
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: "./uutils -> target"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt gettext
- name: Build binaries and GNU tar
run: |
cd 'uutils'
bash util/build-gnu.sh --release-build
- name: Run GNU tests
continue-on-error: true
run: |
cd 'uutils'
bash util/run-gnu-test.sh
- name: Extract info into JSON
run : |
python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_FULL_SUMMARY_FILE }}
- name: Upload full results
uses: actions/upload-artifact@v4
with:
name: gnu-full-result
path: ${{ env.TEST_FULL_SUMMARY_FILE }}
- name: Compress logs
run : |
gzip gnu/tests/*/*.log
- name: Upload logs
uses: actions/upload-artifact@v4
with:
name: test-logs
path: |
gnu/tests/*.log
gnu/tests/*/*.log.gz
aggregate:
needs: [native]
permissions:
actions: read
contents: read
pull-requests: read
name: Aggregate GNU test results
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: 'uutils'
persist-credentials: false
- name: Retrieve reference artifacts
uses: dawidd6/action-download-artifact@v9
continue-on-error: true
with:
workflow: GnuTests.yml
branch: "${{ env.DEFAULT_BRANCH }}"
workflow_conclusion: completed
path: "reference"
- name: Download results
uses: actions/download-artifact@v4
with:
name: gnu-full-result
path: results
- name: Summarize results
id: summary
run: |
eval $(python3 uutils/util/analyze-gnu-results.py -o=${{ env.AGGREGATED_SUMMARY_FILE }} results/*.json)
echo "GNU tests summary = TOTAL: $TOTAL / PASS: $PASS / FAIL: $FAIL / ERROR: $ERROR / SKIP: $SKIP"
jq -n \
--arg date "$(date --rfc-email)" \
--arg sha "$GITHUB_SHA" \
--arg total "$TOTAL" \
--arg pass "$PASS" \
--arg skip "$SKIP" \
--arg fail "$FAIL" \
--arg xpass "$XPASS" \
--arg error "$ERROR" \
'{($date): { sha: $sha, total: $total, pass: $pass, skip: $skip, fail: $fail, xpass: $xpass, error: $error, }}' > '${{ env.TEST_SUMMARY_FILE }}'
- name: Prepare comparison
if: github.event_name == 'pull_request'
run: |
mkdir -p comment
echo "${{ github.event.pull_request.number }}" > comment/NR
- name: Compare results
continue-on-error: true
run: |
REF_SUMMARY_FILE='reference/aggregated-result/${{ env.AGGREGATED_SUMMARY_FILE }}'
CURRENT_SUMMARY_FILE='${{ env.AGGREGATED_SUMMARY_FILE }}'
IGNORE_INTERMITTENT="uutils/.github/workflows/ignore-intermittent.txt"
OUTPUT_ARG=""
if [ "${{ github.event_name }}" == "pull_request" ]; then
OUTPUT_ARG="--output comment/result.txt"
fi
if [ -f "${REF_SUMMARY_FILE}" ]; then
python3 uutils/util/compare_test_results.py \
--ignore-file "${IGNORE_INTERMITTENT}" \
${OUTPUT_ARG} \
"${CURRENT_SUMMARY_FILE}" "${REF_SUMMARY_FILE}"
else
echo "No reference summary found. Skipping comparison."
fi
- name: Upload summary
uses: actions/upload-artifact@v4
with:
name: test-summary
path: "${{ env.TEST_SUMMARY_FILE }}"
- name: Upload aggregated results
uses: actions/upload-artifact@v4
with:
name: aggregated-result
path: ${{ env.AGGREGATED_SUMMARY_FILE }}
- name: Upload comment artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: comment
path: comment