-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Build ROM release from versioned git ref
Signed-off-by: Benjamin Doron <[email protected]>
- Loading branch information
1 parent
eb80750
commit 76849ce
Showing
3 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
name: Versioned Build Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
hw-version: | ||
default: "latest" | ||
type: string | ||
rom-ref: | ||
default: "main" | ||
type: string | ||
firmware-version: | ||
default: "main" | ||
type: string | ||
|
||
jobs: | ||
fpga-full-suite-etrng-log: | ||
name: FPGA Suite (etrng, log) | ||
uses: ./.github/workflows/fpga.yml | ||
with: | ||
artifact-suffix: -fpga-realtime-${{ inputs.hw-version }}-etrng-log | ||
extra-features: slow_tests | ||
hw-version: "${{ inputs.hw-version }}" | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: true | ||
fpga-itrng: false | ||
|
||
fpga-full-suite-etrng-nolog: | ||
name: FPGA Suite (etrng, nolog) | ||
uses: ./.github/workflows/fpga.yml | ||
with: | ||
artifact-suffix: -fpga-realtime-${{ inputs.hw-version }}-etrng-nolog | ||
extra-features: slow_tests | ||
hw-version: "${{ inputs.hw-version }}" | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: false | ||
fpga-itrng: false | ||
|
||
fpga-full-suite-itrng-log: | ||
name: FPGA Suite (itrng, log) | ||
uses: ./.github/workflows/fpga.yml | ||
with: | ||
artifact-suffix: -fpga-realtime-${{ inputs.hw-version }}-itrng-log | ||
extra-features: slow_tests,itrng | ||
hw-version: "${{ inputs.hw-version }}" | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: true | ||
fpga-itrng: true | ||
|
||
fpga-full-suite-itrng-nolog: | ||
name: FPGA Suite (itrng, nolog) | ||
uses: ./.github/workflows/fpga.yml | ||
with: | ||
artifact-suffix: -fpga-realtime-${{ inputs.hw-version }}-itrng-nolog | ||
extra-features: slow_tests,itrng | ||
hw-version: "${{ inputs.hw-version }}" | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: false | ||
fpga-itrng: true | ||
|
||
sw-emulator-full-suite-etrng-log: | ||
name: sw-emulator Suite (etrng, log) | ||
uses: ./.github/workflows/fw-test-emu.yml | ||
with: | ||
artifact-suffix: -sw-emulator-hw-${{ inputs.hw-version }}-etrng-log | ||
extra-features: slow_tests | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: true | ||
|
||
sw-emulator-full-suite-etrng-nolog: | ||
name: sw-emulator Suite (etrng, nolog) | ||
uses: ./.github/workflows/fw-test-emu.yml | ||
with: | ||
artifact-suffix: -sw-emulator-hw-${{ inputs.hw-version }}-etrng-nolog | ||
extra-features: slow_tests | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: false | ||
|
||
sw-emulator-full-suite-itrng-log: | ||
name: sw-emulator Suite (itrng, log) | ||
uses: ./.github/workflows/fw-test-emu.yml | ||
with: | ||
artifact-suffix: -sw-emulator-hw-${{ inputs.hw-version }}-itrng-log | ||
extra-features: slow_tests,itrng | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: true | ||
|
||
sw-emulator-full-suite-itrng-nolog: | ||
name: sw-emulator Suite (itrng, nolog) | ||
uses: ./.github/workflows/fw-test-emu.yml | ||
with: | ||
artifact-suffix: -sw-emulator-hw-${{ inputs.hw-version }}-itrng-nolog | ||
extra-features: slow_tests,itrng | ||
rom-ref: "${{ inputs.rom-ref }}" | ||
rom-logging: false | ||
|
||
create-release: | ||
name: Create New Release | ||
needs: | ||
- fpga-full-suite-etrng-log | ||
- fpga-full-suite-etrng-nolog | ||
- fpga-full-suite-itrng-log | ||
- fpga-full-suite-itrng-nolog | ||
- sw-emulator-full-suite-etrng-log | ||
- sw-emulator-full-suite-etrng-nolog | ||
- sw-emulator-full-suite-itrng-log | ||
- sw-emulator-full-suite-itrng-nolog | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
ref: ${{ inputs.firmware-version }} | ||
|
||
- name: Checkout versioned ROM (${{ inputs.rom-ref }}) | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.rom-ref }} | ||
sparse-checkout: | | ||
rom | ||
# TODO: Continue from here | ||
- name: Generate release zip | ||
run: | | ||
./ci-tools/release/build_release.sh ${{ needs.find-latest-release.outputs.new_release_tag }} | ||
mv ./release/release.zip ./release/caliptra_${{ needs.find-latest-release.outputs.new_release_tag }}.zip | ||
- name: 'Download all artifacts' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
|
||
- name: Package all test artifacts for release | ||
run: | | ||
(cd /tmp/artifacts && zip -r - .) > ./release/test_artifacts_${{ needs.find-latest-release.outputs.new_release_tag }}.zip | ||
- name: Tag repo with new release number | ||
run: | | ||
git config --global user.name "GitHub CI" | ||
git config --global user.email "[email protected]" | ||
git tag ${{ needs.find-latest-release.outputs.new_release_tag }} | ||
git push origin ${{ needs.find-latest-release.outputs.new_release_tag }} | ||
- name: Upload release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
./release/caliptra_${{ needs.find-latest-release.outputs.new_release_tag }}.zip | ||
./release/test_artifacts_${{ needs.find-latest-release.outputs.new_release_tag }}.zip | ||
tag_name: ${{ needs.find-latest-release.outputs.new_release_tag }} | ||
prerelease: true | ||
|
||
- name: Write artifact to workflow with release info | ||
run: | | ||
mkdir /tmp/release-info | ||
echo "${{ needs.find-latest-release.outputs.new_release_tag }}" > /tmp/release-info/tag-name | ||
echo "caliptra_${{ needs.find-latest-release.outputs.new_release_tag }}.zip" > /tmp/release-info/zip-file-name | ||
- name: Write artifact with release info | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-info | ||
path: /tmp/release-info |