Skip to content

Commit

Permalink
[ci] Split sw_{build,test} into two jobs
Browse files Browse the repository at this point in the history
Signed-off-by: James Wainwright <[email protected]>
  • Loading branch information
jwnrt committed Sep 11, 2023
1 parent 617ac40 commit cd315bc
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
continueOnError: True

- job: sw_build
displayName: Earl Grey SW Build & Test
displayName: Earl Grey SW Build
# Build and test Software for Earl Grey toplevel design
timeoutInMinutes: 180
dependsOn: lint
Expand All @@ -199,10 +199,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 Down Expand Up @@ -245,6 +245,54 @@ jobs:
# Export the "TARGET_PATTERN_FILE" variable to be used in tests.
echo "##vso[task.setvariable variable=targetPatternFile]${TARGET_PATTERN_FILE}"
displayName: Build SW
- bash: |
set -x -e
. util/build_consts.sh
# copy the rom to a specific location
ROM_TARGET="${BIN_DIR}/sw/device/silicon_creator/rom"
mkdir -p "${ROM_TARGET}"
# To make the correct query to get the ELF output file, we have to start
# from a node that is built for our usual target platform (the host) and
# follow the edges in the graph across the configuration transition (to
# riscv32). The deps 2 levels down from the opentitan_rom_binary include
# all the important files.
ROM_REAL_TARGETS="deps(//sw/device/silicon_creator/rom:rom_with_real_keys_from_src_fpga_cw310, 2)"
ROM_FAKE_TARGETS="deps(//sw/device/silicon_creator/rom:rom_with_fake_keys_fpga_cw310, 2)"
QUERY_CMD_ARGS=(outquery-all --noinclude_aspects --noimplicit_deps)
ROM_REAL_FILES=($(./bazelisk.sh "${QUERY_CMD_ARGS[@]}" "${ROM_REAL_TARGETS}" | sort | uniq))
ROM_FAKE_FILES=($(./bazelisk.sh "${QUERY_CMD_ARGS[@]}" "${ROM_FAKE_TARGETS}" | sort | uniq))
cp -Lvt "${ROM_TARGET}" "${ROM_FAKE_FILES[@]}" "${ROM_REAL_FILES[@]}"
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/sw/***"

- job: sw_test
displayName: Earl Grey SW Test
# Build and test Software for Earl Grey toplevel design
timeoutInMinutes: 180
dependsOn: sw_build
condition: succeeded()
pool: ci-public
variables:
- name: bazelCacheGcpKeyPath
value: ''
steps:
- template: ci/checkout-template.yml
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- sw_build
- 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
- bash: |
set -x -e
export GCP_BAZEL_CACHE_KEY=$(bazelCacheGcpKeyPath)
Expand Down

0 comments on commit cd315bc

Please sign in to comment.