diff --git a/.github/workflows/fw-test-emu.yml b/.github/workflows/fw-test-emu.yml new file mode 100644 index 0000000000..77177e0fcb --- /dev/null +++ b/.github/workflows/fw-test-emu.yml @@ -0,0 +1,65 @@ + +name: Build and Test Firmware (in emulator) + +on: + workflow_call: + inputs: + artifact-suffix: + type: string + required: false + trng: + default: external + type: string + rom-logging: + default: true + type: boolean + +jobs: + build_and_test: + runs-on: ubuntu-22.04 + + steps: + + - name: Build firmware + run: | + mkdir /tmp/caliptra-firmware + cargo run -p caliptra-builder -- --all_elfs /tmp/caliptra-firmware + + - name: Run tests + run: | + export CALIPTRA_PREBUILT_FW_DIR=/tmp/caliptra-test-firmware + + FEATURE_FLAG= + + if [ "${{ inputs.trng }}" == "external" ] || [ -z "${{ inputs.trng }}" ]; then + echo Using external TRNG + elif [ "${{ inputs.trng }}" == "internal" ] + echo Using internal TRNG + FEATURE_FLAG="--features=itrng" + else + echo "Unexpected inputs.trng: ${{ inputs.rom-logging }}" + fi + + if [ "${{ inputs.rom-logging }}" == "true" ] || [ -z "${{ inputs.rom-logging }}" ]; then + export CPTRA_ROM_TYPE=ROM_WITH_UART + elif [ "${{ inputs.rom-logging }}" == false ]; then + export CPTRA_ROM_TYPE=ROM_WITHOUT_UART + else + echo "Unexpected inputs.rom-logging: ${{ inputs.rom-logging }}" + exit 1 + fi + + cargo-nextest nextest list "${FEATURE_FLAG}" --message-format json > /tmp/nextest-list.json + + cargo-nextest nextest run "${FEATURE_FLAG}" \ + --no-fail-fast \ + --profile=nightly + + - name: 'Upload test results' + uses: actions/upload-artifact@v3 + with: + name: caliptra-test-results${{ inputs.artifact-suffix }} + path: | + /tmp/junit.xml + /tmp/nextest-list.json + diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 8e35c5891f..2ca9f2e748 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -81,6 +81,48 @@ jobs: trng: external rom-logging: false + sw-emulator-full-suite-etrng-log: + name: sw-emulator Suite (etrng, log) +# needs: find-latest-release +# if: needs.find-latest-release.outputs.create_release + uses: ./.github/workflows/fw-test-emu.yml + with: + artifact-suffix: -sw-emulator-realtime-etrng-log + trng: external + rom-logging: true + + sw-emulator-full-suite-etrng-nolog: + name: sw-emulator Suite (etrng, nolog) +# needs: find-latest-release +# if: needs.find-latest-release.outputs.create_release + uses: ./.github/workflows/fw-test-emu.yml + with: + artifact-suffix: -sw-emulator-realtime-etrng-nolog + trng: external + rom-logging: false + + sw-emulator-full-suite-itrng-log: + name: sw-emulator Suite (itrng, log) +# needs: find-latest-release +# if: needs.find-latest-release.outputs.create_release + uses: ./.github/workflows/fw-test-emu.yml + with: + artifact-suffix: -sw-emulator-realtime-itrng-log + trng: internal + rom-logging: true + + sw-emulator-full-suite-itrng-nolog: + name: sw-emulator Suite (itrng, nolog) +# needs: find-latest-release +# if: needs.find-latest-release.outputs.create_release + uses: ./.github/workflows/fw-test-emu.yml + with: + artifact-suffix: -sw-emulator-realtime-itrng-nolog + trng: internal + rom-logging: false + + + # create-release: