Skip to content

Commit 7f458ef

Browse files
committed
[ot] .github/workflows: ci: Separate Earlgrey regression runs by exec env
Extend the `run-bazel-tests.sh` script for running Earlgrey regressions via Bazel to be able to take an execution environment as an optional third argument, defaulting to using the "qemu" tag (which covers all QEMU exec envs), allowing us to retain the same behaviour. Also extend CI, so now we use two separate runners, to allow us to run a `sim_qemu_rom_with_fake_keys` and a `sim_qemu_sival_rom_ext` job in parallel. This should keep CI times shorter despite the increase in tests. Signed-off-by: Alex Jones <[email protected]>
1 parent 781e1d2 commit 7f458ef

File tree

3 files changed

+64
-12
lines changed

3 files changed

+64
-12
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#------------------------------------------------------------------------------
2+
# OpenTitan CI regression runner
3+
#
4+
# Copyright (c) 2025 lowRISC CIC
5+
# SPDX-License-Identifier: Apache License 2.0
6+
#------------------------------------------------------------------------------
7+
8+
name: OT Tests
9+
on:
10+
pull_request:
11+
workflow_dispatch:
12+
inputs:
13+
opentitan_repo:
14+
description: OpenTitan repository to be checked out
15+
required: true
16+
default: lowRISC/opentitan
17+
type: string
18+
opentitan_ref:
19+
description: Branch, tag, or commit ref from OpenTitan to test
20+
required: true
21+
default: earlgrey_1.0.0
22+
type: string
23+
24+
jobs:
25+
earlgrey_rom_with_fake_keys:
26+
name: ROM
27+
uses: ./.github/workflows/eg_regression.yml
28+
secrets: inherit
29+
with:
30+
exec_env: sim_qemu_rom_with_fake_keys
31+
opentitan_repo: ${{ inputs.opentitan_repo || 'lowRISC/opentitan' }}
32+
opentitan_ref: ${{ inputs.opentitan_ref || 'earlgrey_1.0.0' }}
33+
34+
earlgrey_sival_rom_ext:
35+
name: SiVal ROM_EXT
36+
uses: ./.github/workflows/eg_regression.yml
37+
secrets: inherit
38+
with:
39+
exec_env: sim_qemu_sival_rom_ext
40+
opentitan_repo: ${{ inputs.opentitan_repo || 'lowRISC/opentitan' }}
41+
opentitan_ref: ${{ inputs.opentitan_ref || 'earlgrey_1.0.0' }}

.github/workflows/opentitan_regression.yaml renamed to .github/workflows/eg_regression.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#------------------------------------------------------------------------------
2-
# OpenTitan regression runner
2+
# OpenTitan regression run definition
33
#
44
# Copyright (c) 2025 lowRISC CIC
55
# SPDX-License-Identifier: Apache License 2.0
66
#------------------------------------------------------------------------------
77

88
name: OpenTitan Regression
99
on:
10-
pull_request:
11-
workflow_dispatch:
10+
workflow_call:
1211
inputs:
12+
exec_env:
13+
description: OpenTitan QEMU execution environment to test
14+
required: true
15+
default: qemu # Default tag, captures all QEMU exec envs in OpenTitan
16+
type: string
1317
opentitan_repo:
1418
description: OpenTitan repository to be checked out
1519
required: true
@@ -22,8 +26,8 @@ on:
2226
type: string
2327

2428
jobs:
25-
earlgrey:
26-
name: Earlgrey
29+
regression:
30+
name: EG Regression
2731
runs-on: ubuntu-22.04
2832
steps:
2933
- name: Checkout OpenTitan
@@ -57,11 +61,12 @@ jobs:
5761
run: |
5862
set -o pipefail
5963
./qemu/scripts/opentitan/run-bazel-tests.sh ./ qemu \
60-
| tee test_results.txt
64+
${{ inputs.exec_env }} \
65+
| tee ${{ inputs.exec_env }}_test_results.txt
6166
6267
- name: Upload Bazel test results
6368
if: always()
6469
uses: actions/upload-artifact@v4
6570
with:
66-
name: bazel-test-results
67-
path: test_results.txt
71+
name: ${{ inputs.exec_env }}-bazel-test-results
72+
path: ${{ inputs.exec_env }}_test_results.txt

scripts/opentitan/run-bazel-tests.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:-/dev/null}"
2929
# CLI arguments:
3030
opentitan_path="$1"
3131
qemu_path="$2"
32+
qemu_exec_env="$3"
3233
if [ ! -d "$opentitan_path" ] || [ ! -d "$qemu_path" ]; then
33-
echo "USAGE: ${0} <OPENTITAN REPO> <QEMU REPO>"
34+
echo "USAGE: ${0} <OPENTITAN REPO> <QEMU REPO> [<EXEC ENV>]"
3435
exit 1
3536
fi
3637
opentitan_path="$(realpath "$opentitan_path")"
3738
qemu_path="$(realpath "$qemu_path")"
39+
if [ ! "$qemu_exec_env" ]; then
40+
# catch-all tag for all QEMU exec envs
41+
qemu_exec_env="qemu"
42+
echo "Using default 'qemu' tag to test all exec envs"
43+
fi
3844

3945
# Lists of passing and flaky OpenTitan tests:
4046
tests_path="${qemu_path}/tests/opentitan/data/earlgrey-tests.txt"
@@ -82,7 +88,7 @@ trap "cleanup" EXIT
8288
cd "$opentitan_path" >/dev/null
8389

8490
./bazelisk.sh test //... \
85-
--test_tag_filters="qemu" \
91+
--test_tag_filters="$qemu_exec_env" \
8692
--test_summary="short" \
8793
--test_output=all \
8894
--override_repository="+qemu+qemu_opentitan=${qemu_path}" \
@@ -92,10 +98,10 @@ cd "$opentitan_path" >/dev/null
9298
## COMPARE RESULTS
9399

94100
# Ensure the flaky tests are sorted with the current locale.
95-
grep "flaky:" "$tests_path" | cut -d" " -f2 | sort -u > "$flaky"
101+
grep "flaky:.*$qemu_exec_env" "$tests_path" | cut -d" " -f2 | sort -u > "$flaky"
96102

97103
# Load the list of passing tests
98-
grep -E "pass(ing)?:" "$tests_path" | cut -d" " -f2 | sort -u > "$expected"
104+
grep -E "pass(ing)?:.*$qemu_exec_env" "$tests_path" | cut -d" " -f2 | sort -u > "$expected"
99105

100106
# Find all the tests which passed in Bazel:
101107
grep "PASSED[^:]" "$results" | cut -d' ' -f1 | sort > "$all_passed"

0 commit comments

Comments
 (0)