Skip to content

Commit 0547373

Browse files
committed
[ci] upload nightly FPGA test results to gcloud bucket
Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent b1fe995 commit 0547373

File tree

3 files changed

+74
-27
lines changed

3 files changed

+74
-27
lines changed

.github/actions/publish-bazel-test-results/action.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ description: Merge Bazel test results and publish the report
77

88
inputs:
99
merged-results:
10-
description: Path to place merged JUnit report
10+
description: Path to place merged JUnit report.
1111
default: test_results.xml
1212
artifact-name:
1313
description: Name of uploaded artifact. Leave empty to skip upload.
1414
default: ''
15-
bucket-destination:
16-
description: GCP bucket destination to upload report to.
17-
default: ''
15+
upload-to-bucket:
16+
description: Whether to upload results to the Google Cloud Bucket.
17+
default: "false"
18+
branch:
19+
description: Branch name.
20+
default: "${{ github.ref }}"
1821

1922
runs:
2023
using: composite
@@ -45,10 +48,12 @@ runs:
4548
overwrite: true
4649

4750
- name: Upload report to Google Cloud
48-
if: inputs.bucket-destination != ''
51+
if: inputs.upload-to-bucket
4952
shell: bash
5053
run: |
51-
gcloud storage cp "${{ inputs.merged-results }}" "gs://${{ inputs.bucket-destination }}"
54+
BUCKET_PATH=opentitan-test-results/job/${{ github.job }}/branch/${{ inputs.branch }}/$(date +%Y-%m-%d-%H%M%S)_test_results.xml
55+
echo "BUCKET_PATH=$BUCKET_PATH" >> $GITHUB_OUTPUT
56+
gcloud storage cp "${{ inputs.merged-results }}" "gs://${BUCKET_PATH}"
5257
5358
- name: Publish job summary
5459
uses: mikepenz/action-junit-report@ec3a351c13e080dc4fa94c49ab7ad5bf778a9668 # v5

.github/workflows/fpga.yml

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
required: true
1919
type: string
2020
description: FPGA board to use
21+
branch:
22+
default: "${{ github.ref }}"
23+
type: string
24+
description: Branch to checkout
2125
interface:
2226
required: true
2327
type: string
@@ -45,6 +49,10 @@ on:
4549
default: true
4650
type: boolean
4751
description: Skip tests that previously passed and were cached by Bazel
52+
upload_to_bucket:
53+
default: false
54+
type: boolean
55+
description: Whether to upload FPGA results to Google Cloud Bucket
4856

4957
jobs:
5058
fpga:
@@ -54,7 +62,9 @@ jobs:
5462
steps:
5563
- uses: actions/checkout@v4
5664
with:
65+
ref: ${{ inputs.branch }}
5766
fetch-depth: 0
67+
5868
- name: Prepare environment
5969
uses: ./.github/actions/prepare-env
6070
with:
@@ -73,36 +83,46 @@ jobs:
7383
7484
- name: Execute tests
7585
run: |
76-
. util/build_consts.sh
77-
module load "xilinx/vivado/${{ inputs.vivado_version }}"
86+
echo ${{ inputs.branch }}
87+
# TODO: uncomment all this
88+
# . util/build_consts.sh
89+
# module load "xilinx/vivado/${{ inputs.vivado_version }}"
7890
79-
tag_filters="${{ inputs.tag_filters }}"
80-
if ${{ inputs.add_default_filters }}; then
81-
tag_filters+=",-manual,-broken,-slow_test,-skip_in_ci"
82-
fi
91+
# tag_filters="${{ inputs.tag_filters }}"
92+
# if ${{ inputs.add_default_filters }}; then
93+
# tag_filters+=",-manual,-broken,-slow_test,-skip_in_ci"
94+
# fi
8395
84-
# Execute a query to find all targets that match the test tags and store them in a file.
85-
ci/scripts/run-bazel-test-query.sh \
86-
target_pattern_file.txt \
87-
"$tag_filters" \
88-
${{ inputs.targets }}
96+
# # Execute a query to find all targets that match the test tags and store them in a file.
97+
# ci/scripts/run-bazel-test-query.sh \
98+
# target_pattern_file.txt \
99+
# "$tag_filters" \
100+
# ${{ inputs.targets }}
89101
90-
cache_test_results="--cache_test_results=${{ inputs.cache_test_results }}"
102+
# cache_test_results="--cache_test_results=${{ inputs.cache_test_results }}"
91103
92-
# Run FPGA tests
93-
if [[ -s target_pattern_file.txt ]]; then
94-
ci/scripts/run-fpga-tests.sh "${{ inputs.interface }}" target_pattern_file.txt "$cache_test_results" || {
95-
res=$?; echo "To reproduce failures locally, follow the instructions at https://opentitan.org/book/doc/getting_started/setup_fpga.html#reproducing-fpga-ci-failures-locally"; exit "${res}";
96-
}
97-
else
98-
echo "No tests to run after filtering"
99-
fi
104+
# # Run FPGA tests
105+
# if [[ -s target_pattern_file.txt ]]; then
106+
# ci/scripts/run-fpga-tests.sh "${{ inputs.interface }}" target_pattern_file.txt "$cache_test_results" || {
107+
# res=$?; echo "To reproduce failures locally, follow the instructions at https://opentitan.org/book/doc/getting_started/setup_fpga.html#reproducing-fpga-ci-failures-locally"; exit "${res}";
108+
# }
109+
# else
110+
# echo "No tests to run after filtering"
111+
# fi
112+
113+
- uses: actions/checkout@v4
114+
with:
115+
ref: ${{ github.ref }}
116+
path: "upload-branch"
117+
fetch-depth: 1
100118

101119
- name: Publish Bazel test results
102-
uses: ./.github/actions/publish-bazel-test-results
120+
uses: ./upload-branch/.github/actions/publish-bazel-test-results
103121
if: ${{ !cancelled() }}
104122
with:
105123
artifact-name: ${{ inputs.job_name }}-test-results
124+
upload-to-bucket: ${{ inputs.upload_to_bucket }}
125+
branch: ${{ inputs.branch }}
106126

107127
- name: Upload target pattern file
108128
if: ${{ !cancelled() }}

.github/workflows/nightly.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
tag_filters: cw310_test_rom,-broken,-manual
6060
add_default_filters: false
6161
cache_test_results: false
62+
upload_to_bucket: true
63+
branch: "${{ inputs.branch }}"
6264

6365
execute_fpga_cw310_rom_tests:
6466
name: CW310 ROM Tests
@@ -74,6 +76,8 @@ jobs:
7476
add_default_filters: false
7577
cache_test_results: false
7678
timeout: 240
79+
upload_to_bucket: true
80+
branch: "${{ inputs.branch }}"
7781

7882
execute_fpga_cw310_rom_ext_tests:
7983
name: CW310 ROM_EXT Tests
@@ -88,6 +92,8 @@ jobs:
8892
tag_filters: cw310_rom_ext,-broken,-manual
8993
add_default_filters: false
9094
cache_test_results: false
95+
upload_to_bucket: true
96+
branch: "${{ inputs.branch }}"
9197

9298
execute_fpga_cw310_sival_tests:
9399
name: CW310 SiVal Tests
@@ -102,6 +108,8 @@ jobs:
102108
tag_filters: cw310_sival,-broken,-manual
103109
add_default_filters: false
104110
cache_test_results: false
111+
upload_to_bucket: true
112+
branch: "${{ inputs.branch }}"
105113

106114
execute_fpga_cw310_sival_rom_ext_tests:
107115
name: CW310 SiVal ROM_EXT Tests
@@ -116,6 +124,8 @@ jobs:
116124
tag_filters: cw310_sival_rom_ext,-broken,-manual
117125
add_default_filters: false
118126
cache_test_results: false
127+
upload_to_bucket: true
128+
branch: "${{ inputs.branch }}"
119129

120130
execute_fpga_cw310_bob_tests:
121131
name: CW310 BoB (SPI and I2C) Tests
@@ -131,6 +141,8 @@ jobs:
131141
tag_filters: cw310_sival_rom_ext_no_hyper,-broken,-manual
132142
add_default_filters: false
133143
cache_test_results: false
144+
upload_to_bucket: true
145+
branch: "${{ inputs.branch }}"
134146

135147
execute_fpga_cw340_test_rom_tests:
136148
name: CW340 SiVal Test ROM Tests
@@ -145,6 +157,8 @@ jobs:
145157
tag_filters: cw340_test_rom,-broken,-manual
146158
add_default_filters: false
147159
cache_test_results: false
160+
upload_to_bucket: true
161+
branch: "${{ inputs.branch }}"
148162

149163
execute_fpga_cw340_rom_tests:
150164
name: CW340 SiVal ROM Tests
@@ -159,6 +173,8 @@ jobs:
159173
tag_filters: cw340_rom_with_fake_keys,-broken,-manual
160174
add_default_filters: false
161175
cache_test_results: false
176+
upload_to_bucket: true
177+
branch: "${{ inputs.branch }}"
162178

163179
execute_fpga_cw340_rom_ext_tests:
164180
name: CW340 SiVal ROM_EXT Tests
@@ -173,6 +189,8 @@ jobs:
173189
tag_filters: cw340_rom_ext,-broken,-manual
174190
add_default_filters: false
175191
cache_test_results: false
192+
upload_to_bucket: true
193+
branch: "${{ inputs.branch }}"
176194

177195
execute_fpga_cw340_sival_tests:
178196
name: CW340 SiVal Tests
@@ -187,6 +205,8 @@ jobs:
187205
tag_filters: cw340_sival,-broken,-manual
188206
add_default_filters: false
189207
cache_test_results: false
208+
upload_to_bucket: true
209+
branch: "${{ inputs.branch }}"
190210

191211
execute_fpga_cw340_sival_rom_ext_tests:
192212
name: CW340 SiVal ROM_EXT Tests
@@ -202,6 +222,8 @@ jobs:
202222
add_default_filters: false
203223
cache_test_results: false
204224
timeout: 90
225+
upload_to_bucket: true
226+
branch: "${{ inputs.branch }}"
205227

206228
slow_otbn_crypto_tests:
207229
name: Slow OTBN Crypto Tests

0 commit comments

Comments
 (0)