forked from chipsalliance/caliptra-sw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
113 changed files
with
5,603 additions
and
514 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,96 @@ | ||
name: Nightly Release | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# 2:11 AM PST tuesday-saturday | ||
- cron: '11 10 * * 2-6' | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
# Disable RTL-Repo-Sync until manual fixes to work with the latest RTL are not made | ||
#rtl-repo-sync: | ||
# name: RTL Repo Sync | ||
# uses: ./.github/workflows/rtl-repo-sync.yml | ||
|
||
find-latest-release: | ||
name: Find Latest Release | ||
#needs: rtl-repo-sync | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
create_release: ${{ steps.find.outputs.create_release }} | ||
new_release_tag: ${{ steps.find.outputs.new_release_tag }} | ||
release_ref: ${{ steps.find.outputs.release_ref }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
ref: 'main' | ||
fetch-depth: 0 | ||
|
||
- name: Find latest release | ||
id: find | ||
run: | | ||
DATE="$(date +'%Y%m%d')" | ||
TAG_PREFIX="release_v" | ||
TAG_BASE="${TAG_PREFIX}${DATE}_" | ||
INDEX=0 | ||
while git tag | grep ${TAG_BASE}${INDEX}; do | ||
((INDEX+=1)) | ||
done | ||
MOST_RECENT_RELEASE=None | ||
if git tag | grep ${TAG_PREFIX} > /dev/null; then | ||
MOST_RECENT_RELEASE=$(git tag | grep ${TAG_PREFIX} | sort -r | head -1) | ||
fi | ||
if [[ "$MOST_RECENT_RELEASE" == "None" ]]; then | ||
echo "create_release=true" >> $GITHUB_OUTPUT | ||
else | ||
COMMITS_AFTER_LAST_RELEASE=$(git rev-list --count $MOST_RECENT_RELEASE..HEAD) | ||
if [[ $COMMITS_AFTER_LAST_RELEASE -gt 0 ]]; then | ||
echo "create_release=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "create_release=false" >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
echo "new_release_tag=${TAG_BASE}${INDEX}" >> $GITHUB_OUTPUT | ||
echo "release_ref=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
echo "Current ref $(git rev-parse HEAD) will receive tag ${TAG_BASE}${INDEX} after tests" | ||
verilator-full-suite: | ||
name: Nightly Verilator Suite | ||
needs: find-latest-release | ||
if: needs.find-latest-release.outputs.create_release | ||
uses: ./.github/workflows/nightly-verilator.yml | ||
|
||
|
||
create-release: | ||
name: Create New Release | ||
needs: [find-latest-release, verilator-full-suite] | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
ref: ${{ needs.find-latest-release.outputs.release_ref }} | ||
|
||
- 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: 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 | ||
tag_name: ${{ needs.find-latest-release.outputs.new_release_tag }} |
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,90 @@ | ||
name: RTL Repo Sync | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-rtl: | ||
name: Update RTL Submodule | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
branch_name: ${{ steps.branch.outputs.branch }} | ||
ci_checks_needed: ${{ steps.status.outputs.status }} | ||
branch_base_ref: ${{ steps.commit.outputs.branch_base_ref }} | ||
steps: | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
ref: 'main' | ||
|
||
- name: Update the Caliptra RTL submodule and rebuild registers | ||
run: | | ||
echo "RTL-REPO-SYNC: release_ref=$(git rev-parse HEAD)" | ||
git submodule update --remote hw-latest/caliptra-rtl | ||
./registers/update.sh | ||
- name: Find available branch name | ||
id: branch | ||
run: | | ||
BRANCH_BASE=ci_rtl_${{ steps.date.outputs.date }} | ||
INDEX=0 | ||
while git ls-remote --exit-code --heads origin ${BRANCH_BASE}_${INDEX} | ||
do | ||
((INDEX+=1)) | ||
done | ||
echo "branch=${BRANCH_BASE}_${INDEX}" >> $GITHUB_OUTPUT | ||
- name: Run git status | ||
id: status | ||
run: echo "status=$(git status -s | head -1)" >> $GITHUB_OUTPUT | ||
|
||
# If there's a new HW release (submodule has been updated), add a commit to main branch | ||
- name: Commit changes | ||
id: commit | ||
if: ${{ steps.status.outputs.status }} | ||
run: | | ||
git config --global user.name "GitHub CI" | ||
git config --global user.email "[email protected]" | ||
echo "branch_base_ref=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
git checkout -b ${{ steps.branch.outputs.branch }} | ||
git commit -a -m "CI: Update Caliptra RTL" | ||
git push -u origin ${{ steps.branch.outputs.branch }} | ||
build-test: | ||
uses: ./.github/workflows/build-test.yml | ||
needs: update-rtl | ||
if: needs.update-rtl.outputs.ci_checks_needed | ||
|
||
build-test-verilator: | ||
uses: ./.github/workflows/build-test-verilator.yml | ||
needs: update-rtl | ||
if: needs.update-rtl.outputs.ci_checks_needed | ||
|
||
merge-rtl-update: | ||
name: Merge RTL Update | ||
needs: [update-rtl, build-test, build-test-verilator] | ||
if: needs.update-rtl.outputs.ci_checks_needed | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
ref: 'main' | ||
fetch-depth: 0 | ||
|
||
- name: Merge RTL changes to main branch | ||
run: | | ||
git config --global user.name "GitHub CI" | ||
git config --global user.email "[email protected]" | ||
if [[ "${{ needs.update-rtl.outputs.branch_base_ref }}" != $(git rev-parse HEAD) ]]; then | ||
echo "Commit added to main after CI RTL branch test started; cannot auto-merge branch" | ||
exit 1 | ||
fi | ||
git push origin ${{ needs.update-rtl.outputs.branch_name }} main | ||
git push origin --delete ${{ needs.update-rtl.outputs.branch_name }} |
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
Oops, something went wrong.