diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 118741c8a0b80c..ce2a5fe85ed6f2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 @@ -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 @@ -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)