Skip to content

Commit

Permalink
release: Also run FPGA tests against non-logging ROM.
Browse files Browse the repository at this point in the history
This is the binary that we expect folks to burn into silicon, so we
should be testing it.
  • Loading branch information
korran authored and jhand2 committed Nov 23, 2023
1 parent ae61cca commit 2d5627b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 20 deletions.
53 changes: 36 additions & 17 deletions .github/workflows/fpga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ on:
branches: ["main"]
pull_request:
workflow_call:
inputs:
artifact-suffix:
type: string
required: false
extra-features:
default:
type: string
rom-logging:
default: true
type: boolean

workflow_dispatch:


Expand Down Expand Up @@ -56,21 +67,18 @@ jobs:
if: steps.restore_rtl_cache.outputs.cache-hit
uses: actions/upload-artifact@v3
with:
name: caliptra-fpga-bitstream
name: caliptra-fpga-bitstream${{ inputs.artifact-suffix }}
path: /tmp/caliptra-fpga-bitstream/caliptra_fpga.bin
retention-days: 7

- name: 'Upload kernel module artifacts'
if: steps.restore_kmod_cache.outputs.cache-hit
uses: actions/upload-artifact@v3
with:
name: caliptra-fpga-kmod
name: caliptra-fpga-kmod${{ inputs.artifact-suffix }}
path: /tmp/caliptra-fpga-kmod/
retention-days: 1




build_test_binaries:
runs-on: [e2-standard-32]
timeout-minutes: 60
Expand Down Expand Up @@ -136,7 +144,7 @@ jobs:
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="aarch64-linux-gnu-gcc"
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=--sysroot=$FARGO_SYSROOT"
cargo nextest archive \
--features=fpga_realtime \
--features=fpga_realtime,${{ inputs.extra-features }} \
--release \
--target=aarch64-unknown-linux-gnu \
--archive-file=/tmp/caliptra-test-binaries.tar.zst
Expand All @@ -148,7 +156,7 @@ jobs:
- name: 'Upload test binaries artifact'
uses: actions/upload-artifact@v3
with:
name: caliptra-test-binaries
name: caliptra-test-binaries${{ inputs.artifact-suffix }}
path: /tmp/caliptra-test-binaries.sqsh
retention-days: 1

Expand All @@ -160,7 +168,7 @@ jobs:
- name: 'Upload test firmware artifact'
uses: actions/upload-artifact@v3
with:
name: caliptra-test-firmware
name: caliptra-test-firmware${{ inputs.artifact-suffix }}
path: /tmp/caliptra-test-firmware
retention-days: 1

Expand Down Expand Up @@ -223,7 +231,7 @@ jobs:
- name: 'Upload kernel module artifacts'
uses: actions/upload-artifact@v3
with:
name: caliptra-fpga-kmod
name: caliptra-fpga-kmod${{ inputs.artifact-suffix }}
path: /tmp/caliptra-fpga-kmod/
retention-days: 1

Expand Down Expand Up @@ -258,7 +266,7 @@ jobs:
- name: 'Upload FPGA bitstream artifact'
uses: actions/upload-artifact@v3
with:
name: caliptra-fpga-bitstream
name: caliptra-fpga-bitstream${{ inputs.artifact-suffix }}
path: hw-latest/fpga/caliptra_build/caliptra_fpga.bin

cache_fpga_bitstream_artifact:
Expand All @@ -274,7 +282,7 @@ jobs:
- name: 'Download FPGA Bitstream Artifact'
uses: actions/download-artifact@v3
with:
name: caliptra-fpga-bitstream
name: caliptra-fpga-bitstream${{ inputs.artifact-suffix }}
path: /tmp/caliptra-fpga-bitstream

- name: Save FPGA bitstream to cache
Expand Down Expand Up @@ -304,25 +312,25 @@ jobs:
- name: 'Download FPGA Bitstream Artifact'
uses: actions/download-artifact@v3
with:
name: caliptra-fpga-bitstream
name: caliptra-fpga-bitstream${{ inputs.artifact-suffix }}
path: /tmp/caliptra-fpga-bitstream

- name: 'Download kernel driver artifacts'
uses: actions/download-artifact@v3
with:
name: caliptra-fpga-kmod
name: caliptra-fpga-kmod${{ inputs.artifact-suffix }}
path: /tmp/caliptra-fpga-kmod/

- name: 'Download Test Binaries Artifact'
uses: actions/download-artifact@v3
with:
name: caliptra-test-binaries
name: caliptra-test-binaries${{ inputs.artifact-suffix }}
path: /tmp/caliptra-test-binaries.sqsh

- name: 'Download Test Firmware Artifact'
uses: actions/download-artifact@v3
with:
name: caliptra-test-firmware
name: caliptra-test-firmware${{ inputs.artifact-suffix }}
path: /tmp/caliptra-test-firmware

- name: Mount binaries
Expand Down Expand Up @@ -372,6 +380,16 @@ jobs:
TEST_BIN=/tmp/caliptra-test-binaries
VARS="CPTRA_UIO_NUM=4 CALIPTRA_PREBUILT_FW_DIR=/tmp/caliptra-test-firmware CALIPTRA_IMAGE_NO_GIT_REVISION=1"
if [ "${{ inputs.rom-logging }}" == "true" ] || [ -z "${{ inputs.rom-logging }}" ]; then
VARS+=" CPTRA_ROM_TYPE=ROM_WITH_UART"
elif [ "${{ inputs.rom-logging }}" == false ]; then
VARS+=" CPTRA_ROM_TYPE=ROM_WITHOUT_UART"
else
echo "Unexpected inputs.rom-logging: ${{ inputs.rom-logging }}"
exit 1
fi
echo CPTRA_ROM_TYPE=${CPTRA_ROM_TYPE}
COMMON_ARGS=(
--cargo-metadata="${TEST_BIN}/target/nextest/cargo-metadata.json"
--binaries-metadata="${TEST_BIN}/target/nextest/binaries-metadata.json"
Expand All @@ -396,8 +414,9 @@ jobs:
- name: 'Upload test results'
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: caliptra-test-results
name: caliptra-test-results${{ inputs.artifact-suffix }}
path: |
/tmp/junit.xml
/tmp/nextest-list.json
/tmp/nextest-list.json
20 changes: 17 additions & 3 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,29 @@ jobs:
echo "release_ref=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "Current ref $(git rev-parse HEAD) will receive tag ${TAG_BASE}${INDEX} after tests"
fpga-full-suite:
name: FPGA Suite
fpga-full-suite-etrng-log:
name: FPGA Suite (etrng, log)
needs: find-latest-release
if: needs.find-latest-release.outputs.create_release
uses: ./.github/workflows/fpga.yml
with:
artifact-suffix: -fpga-realtime-etrng-log
extra-features: slow_tests
rom-logging: true

fpga-full-suite-etrng-nolog:
name: FPGA Suite (etrng, nolog)
needs: find-latest-release
if: needs.find-latest-release.outputs.create_release
uses: ./.github/workflows/fpga.yml
with:
artifact-suffix: -fpga-realtime-etrng-nolog
extra-features: slow_tests
rom-logging: false

create-release:
name: Create New Release
needs: [find-latest-release, fpga-full-suite]
needs: [find-latest-release, fpga-full-suite-etrng-log, fpga-full-suite-etrng-nolog]
runs-on: ubuntu-22.04

steps:
Expand Down

0 comments on commit 2d5627b

Please sign in to comment.