Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Split the 'SW build & test' job into build and test jobs #19577

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 45 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ jobs:
displayName: Verible FPV (Verilog lint)

- job: sw_build
displayName: Earl Grey SW Build & Test
# Build and test Software for Earl Grey toplevel design
timeoutInMinutes: 210
displayName: Earl Grey SW Build
# Build software tests for the Earl Grey toplevel design
timeoutInMinutes: 120
dependsOn: lint
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyCdcChanges'], '0'))
pool: ci-public
Expand All @@ -190,10 +190,10 @@ jobs:
name: bazelCacheGcpKey
inputs:
secureFile: "bazel_cache_gcp_key.json"
# Set the remote cache GCP key path
- bash: echo "##vso[task.setvariable variable=bazelCacheGcpKeyPath]$(bazelCacheGcpKey.secureFilePath)"
condition: eq(variables['Build.SourceBranchName'], 'master')
displayName: GCP key path
# Set the remote cache GCP key path
- bash: |
set -x -e
# Check the entire build graph for conflicts in loading or analysis
Expand All @@ -202,8 +202,8 @@ jobs:
ci/scripts/test-empty-bitstream-cache.sh
# Now redo with the real bitstream cache included.
ci/bazelisk.sh build --nobuild //...
# This command builds all software and runs all unit tests that run on the
# host, with a few exceptions:

# This command selects the unit tests to be built:
# * It excludes //quality because that's the purview of `slow_lints`.
# * It excludes //sw/otbn/crypto because that's tested in `otbn_crypto_tests`.
# * It excludes the tests from //third_party/riscv-compliance because
Expand All @@ -215,7 +215,7 @@ jobs:
# * It excludes targets that depend on bitstream_splice rules, since the
# environment does not have access to Vivado.
export GCP_BAZEL_CACHE_KEY=$(bazelCacheGcpKeyPath)
TARGET_PATTERN_FILE=$(mktemp)
jwnrt marked this conversation as resolved.
Show resolved Hide resolved
TARGET_PATTERN_FILE=target_pattern.txt
echo //... > "${TARGET_PATTERN_FILE}"
echo -//quality/... >> "${TARGET_PATTERN_FILE}"
echo -//sw/otbn/crypto/... >> "${TARGET_PATTERN_FILE}"
Expand All @@ -228,19 +228,16 @@ jobs:
--define DISABLE_VERILATOR_BUILD=true \
-- "rdeps(//..., kind(bitstream_splice, //...))" \
>> "${TARGET_PATTERN_FILE}"

# Build all unit tests and their dependencies.
ci/bazelisk.sh build \
--build_tests_only=false \
--define DISABLE_VERILATOR_BUILD=true \
--test_tag_filters=-broken,-cw310,-verilator,-dv \
--target_pattern_file="${TARGET_PATTERN_FILE}"
ci/bazelisk.sh test \
--build_tests_only=false \
--test_output=errors \
--define DISABLE_VERILATOR_BUILD=true \
--test_tag_filters=-broken,-cw310,-verilator,-dv \
--target_pattern_file="${TARGET_PATTERN_FILE}"
displayName: Build & test SW
- template: ci/publish-bazel-test-results.yml
displayName: Build SW
- publish: target_pattern.txt
artifact: target_pattern_file
- bash: |
set -x -e
. util/build_consts.sh
Expand All @@ -258,6 +255,39 @@ jobs:
includePatterns:
- "/sw/***"

- job: sw_test
displayName: Earl Grey SW Test
timeoutInMinutes: 120
dependsOn: sw_build
pool: ci-public
variables:
- name: bazelCacheGcpKeyPath
value: ''
steps:
- template: ci/checkout-template.yml
- template: ci/install-package-dependencies.yml
- task: DownloadSecureFile@1
condition: eq(variables['Build.SourceBranchName'], 'master')
name: bazelCacheGcpKey
inputs:
secureFile: "bazel_cache_gcp_key.json"
# Set the remote cache GCP key path
- bash: echo "##vso[task.setvariable variable=bazelCacheGcpKeyPath]$(bazelCacheGcpKey.secureFilePath)"
condition: eq(variables['Build.SourceBranchName'], 'master')
displayName: GCP key path
- download: current
artifact: target_pattern_file
- bash: |
TARGET_PATTERN_FILE="$(Pipeline.Workspace)/target_pattern_file/target_pattern.txt"
ci/bazelisk.sh test \
--build_tests_only=false \
--test_output=errors \
--define DISABLE_VERILATOR_BUILD=true \
--test_tag_filters=-broken,-cw310,-verilator,-dv \
--target_pattern_file="${TARGET_PATTERN_FILE}"
displayName: Build & test SW
- template: ci/publish-bazel-test-results.yml

- job: chip_englishbreakfast_verilator
displayName: Verilated English Breakfast (Build)
# Build Verilator simulation of the English Breakfast toplevel design
Expand Down
Loading