-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] refactor workflows into multiple runs
- Loading branch information
Showing
4 changed files
with
157 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Verilator Test | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
- labeled | ||
env: | ||
USER: runner | ||
|
||
# Cancel the current workflow when new commit pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-emit: | ||
if: '! github.event.pull_request.draft' | ||
name: "Test elaborate" | ||
runs-on: [self-hosted, linux, nixos] | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: "Test elaborate" | ||
run: | | ||
configArray=( $(ls configgen/generated | sed 's/\.json$//') ) | ||
for cfg in "${configArray[@]}"; do | ||
echo "Building .#t1.${cfg}.ip.rtl" | ||
if ! nix build ".#t1.${cfg}.ip.rtl" -L; then | ||
failed_rtl_configs+=("${cfg}.ip") | ||
fi | ||
echo "Building .#t1.${cfg}.subsystem.rtl" | ||
if ! nix build ".#t1.${cfg}.subsystem.rtl" -L; then | ||
failed_rtl_configs+=("${cfg}.subsystem") | ||
fi | ||
if ! nix run ".#ci-helper" -- runOMTests --config ${cfg}; then | ||
failed_om+=("${cfg}") | ||
fi | ||
done | ||
if [ -n "${failed_rtl_configs[*]}" ]; then | ||
echo -e "## Failed RTL\n" >> "$GITHUB_STEP_SUMMARY" | ||
for cfg in "${failed_rtl_configs[@]}"; do | ||
echo "* ${cfg}" >> $GITHUB_STEP_SUMMARY | ||
done | ||
echo -e "## Failed RTL\n" >> "$GITHUB_STEP_SUMMARY" | ||
for cfg in "${failed_om[@]}"; do | ||
echo "* ${cfg}" >> $GITHUB_STEP_SUMMARY | ||
done | ||
printf "\n" >> $GITHUB_STEP_SUMMARY | ||
fi | ||
# Require it pass, since PD depends on the result of OM. | ||
- name: "Run OM tests" | ||
run: | | ||
nix run ".#ci-helper" -- runOMTests --jobs "${{ matrix.jobs }}" | ||
physical-design-report: | ||
name: "Request physical design report" | ||
if: ${{ success() && (contains(github.event.pull_request.labels.*.name, 'PD-Lane') || contains(github.event.pull_request.labels.*.name, 'PD-Lane-DBG'))}} | ||
runs-on: ubuntu-latest | ||
needs: [test-emit] | ||
steps: | ||
- name: "Request report" | ||
env: | ||
# Use env key can help us inspect the data | ||
JSON_CTX: ${{ toJson(github.event.pull_request.labels.*.name) }} | ||
run: | | ||
# GitHub `toJson` will pretty print JSON and causing multiple line escape issue | ||
# So we have to redirect it to file here | ||
printf "$JSON_CTX" > _ctx.json | ||
pdType=$(jq -r 'map(select(. | test("^PD-Lane.*"))) | .[0]' _ctx.json) | ||
if [[ -z "$pdType" ]] || [[ "$pdType" == "null" ]]; then | ||
echo "Unable to filter Physical Design type" | ||
exit 1 | ||
fi | ||
commitSha="${{ github.event.pull_request.head.sha }}" | ||
prId="${{ github.event.pull_request.number }}" | ||
jq -n \ | ||
--arg commit_sha "$commitSha" \ | ||
--arg pr_id "$prId" \ | ||
--arg pd_type "$pdType" \ | ||
'{"event_type":"ci_success","client_payload":{"commit_sha": $commit_sha,"pr_id": $pr_id, "pd_type": $pd_type }}' \ | ||
> payload.json | ||
curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.T1_INHOUSE_PAT }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"${{ secrets.T1_INHOUSE_URL }}" \ | ||
-d '@payload.json' |
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,60 @@ | ||
name: Compile Wave Trace | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
- labeled | ||
env: | ||
USER: runner | ||
|
||
# Cancel the current workflow when new commit pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
gen-test-plan: | ||
if: '! github.event.pull_request.draft' | ||
name: "Generate test plan" | ||
runs-on: [self-hosted, linux, nixos] | ||
outputs: | ||
testplan: ${{ steps.get-all-configs.outputs.out }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- id: "get-all-configs" | ||
run: echo "out=$(nix run .#ci-helper generateTestPlan)" > $GITHUB_OUTPUT | ||
|
||
build-vcs-emulators: | ||
name: "Build VCS trace emulators" | ||
needs: [gen-test-plan] | ||
runs-on: [self-hosted, linux, nixos, BIGRAM] | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.gen-test-plan.outputs.testplan) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: "Build vcs emulator" | ||
run: | | ||
nix build '.#t1.${{ matrix.config }}.ip.vcs-emu-trace' --impure --no-link --cores 64 | ||
# In the future, we may choose Verdi for trace, and left verilator trace only for performance evaluation | ||
build-verilator-trace-emulators: | ||
name: "Build verilator trace emulators" | ||
needs: [gen-test-plan] | ||
runs-on: [self-hosted, linux, nixos, BIGRAM] | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.gen-test-plan.outputs.testplan) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: "Build verilator emulator with trace" | ||
run: nix build '.#t1.${{ matrix.config }}.ip.verilator-emu-trace' -L --no-link --cores 64 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: VCS | ||
name: VCS Test | ||
on: | ||
pull_request: | ||
types: | ||
|
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