Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
self-hosted-runner:
labels:
- rise-gcc-ci
- rise-precommit-regression-07
56 changes: 16 additions & 40 deletions .github/actions/common/download-comparison-artifacts/action.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: "Download Comparison Artifacts"
description: "Downloads artifacts needed for run comparison"
description: "Collect one testsuite report from the current workflow run"
inputs:
report-artifact-name:
required: true
binary-artifact-name:
required: true
github-token:
required: true
repo:
Expand All @@ -13,44 +11,22 @@ inputs:
runs:
using: "composite"
steps:
- name: Download report from this workflow
if: ${{ !cancelled() }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.report-artifact-name }}
path: ./riscv-gnu-toolchain/current_logs
continue-on-error: true

- name: Download report from another workflow
if: ${{ !cancelled() && hashFiles(format('./riscv-gnu-toolchain/current_logs/{0}', inputs.report-artifact-name)) == '' }}
shell: bash
run: |
cd riscv-gnu-toolchain
python ./scripts/download_artifact.py -name ${{ inputs.report-artifact-name }} -repo ${{ inputs.repo }} -token ${{ inputs.github-token }} -outdir current_logs
continue-on-error: true

- name: Download rv32 non-multilib binary
if: ${{ !cancelled() && hashFiles(format('./riscv-gnu-toolchain/current_logs/{0}', inputs.report-artifact-name)) == '' }}
id: same-workflow-binary
uses: actions/download-artifact@v4
with:
name: ${{ inputs.binary-artifact-name }}
path: ./riscv-gnu-toolchain/temp
continue-on-error: true

- name: Download binary from another workflow
if: ${{ !cancelled() && hashFiles(format('./riscv-gnu-toolchain/current_logs/{0}', inputs.report-artifact-name)) == '' && steps.same-workflow-binary.outcome == 'failure' }}
shell: bash
run: |
cd riscv-gnu-toolchain
python ./scripts/download_artifact.py -name ${{ inputs.binary-artifact-name }} -repo ${{ inputs.repo }} -token ${{ inputs.github-token }} -outdir temp
continue-on-error: true

- name: Record missing testsuite report
if: ${{ !cancelled() && hashFiles(format('./riscv-gnu-toolchain/current_logs/{0}', inputs.report-artifact-name)) == '' }}
- name: Collect the expected report from this run
shell: bash
env:
REPORT_ARTIFACT_NAME: ${{ inputs.report-artifact-name }}
GH_TOKEN: ${{ inputs.github-token }}
REPOSITORY: ${{ inputs.repo }}
REPORT_NAME: ${{ inputs.report-artifact-name }}
run: |
directory=$(mktemp -d)
gh api --paginate "repos/$REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts?per_page=100" \
--jq '.artifacts[] | select(.expired == false and .size_in_bytes <= 268435456) | [.name, .id] | @tsv' > "$directory/artifacts.tsv"
artifact_id=$(awk -F '\t' -v name="$REPORT_NAME" '$1 == name {print $2; exit}' "$directory/artifacts.tsv")
if [[ "$artifact_id" =~ ^[0-9]+$ ]]; then
gh api "repos/$REPOSITORY/actions/artifacts/$artifact_id/zip" > "$directory/report.zip"
if python scripts/collect_testsuite_report.py "$directory/report.zip" "$REPORT_NAME" riscv-gnu-toolchain/current_logs; then
exit 0
fi
fi
mkdir -p riscv-gnu-toolchain/current_logs
printf '%s|Testsuite report artifact could not be downloaded\n' "$REPORT_ARTIFACT_NAME" >> riscv-gnu-toolchain/current_logs/failed_testsuite.txt
printf '%s|Testsuite report missing or invalid in this run\n' "$REPORT_NAME" >> riscv-gnu-toolchain/current_logs/failed_testsuite.txt
3 changes: 0 additions & 3 deletions .github/actions/download-all-comparison-artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,20 @@ runs:
uses: ./.github/actions/common/download-comparison-artifacts
with:
report-artifact-name: gcc-linux-rv64gc_zba_zbb_zbc_zbs-lp64d-${{ inputs.gcchash }}-multilib-report.log
binary-artifact-name: gcc-linux-rv64gc_zba_zbb_zbc_zbs-lp64d-${{ inputs.gcchash }}-multilib
github-token: ${{ inputs.token }}
repo: ${{ inputs.repo }}

- name: Download linux rv64 vector multilib
uses: ./.github/actions/common/download-comparison-artifacts
with:
report-artifact-name: gcc-linux-rv64gcv-lp64d-${{ inputs.gcchash }}-multilib-report.log
binary-artifact-name: gcc-linux-rv64gcv-lp64d-${{ inputs.gcchash }}-multilib
github-token: ${{ inputs.token }}
repo: ${{ inputs.repo }}

- name: Download newlib rv64 vector multilib
uses: ./.github/actions/common/download-comparison-artifacts
with:
report-artifact-name: gcc-newlib-rv64gcv-lp64d-${{ inputs.gcchash }}-multilib-report.log
binary-artifact-name: gcc-newlib-rv64gcv-lp64d-${{ inputs.gcchash }}-multilib
github-token: ${{ inputs.token }}
repo: ${{ inputs.repo }}

Expand Down
38 changes: 27 additions & 11 deletions .github/actions/report-build-complete-status/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
build_status:
description: 'Build status'
required: true
patch_id:
description: 'Patchwork ID from trusted discovery metadata'
required: true
patch_name:
description: 'Name of patch'
required: true
Expand Down Expand Up @@ -56,15 +59,23 @@ runs:
python scripts/update_issue_status.py -token ${{ inputs.github_token }} -state 'Success' -comment ${{ inputs.build_comment_id }} -target ${{ inputs.target }} -check 'Build GCC' -repo '${{ inputs.repository }}' -baseline $HASH
printf "\n[Additional information](${{ inputs.additional_info }})\n" >> comment.md

- name: Read build log previews
id: preview
if: ${{ inputs.build_status == 'failure' && inputs.gist_token != '' }}
shell: bash
env:
GH_TOKEN: ${{ inputs.github_token }}
LOG_NAME: ${{ inputs.build_log_name }}
run: python3 scripts/build_log_preview.py "$LOG_NAME" "$RUNNER_TEMP/build-preview"
continue-on-error: true

- name: Build combined stdout/stderr gist
if: ${{ inputs.build_status == 'failure' }}
if: ${{ steps.preview.outcome == 'success' }}
id: tail-gist-url
shell: bash
working-directory: riscv-gnu-toolchain
run: |
ONE_MB_IN_BYTES=1048000
tail -c $ONE_MB_IN_BYTES build/${{ inputs.build_log_name }}.log >> gist.md
python3 ./scripts/create_gist.py --token ${{ inputs.gist_token }} --input gist.md --output gist_url.txt --title ${{ inputs.issue_num }}_${{ inputs.patch_name }}_${{ inputs.build_log_name }}.log
python3 ./scripts/create_gist.py --token ${{ inputs.gist_token }} --input "$RUNNER_TEMP/build-preview/stdout.txt" --output gist_url.txt --title ${{ inputs.issue_num }}_${{ inputs.patch_name }}_${{ inputs.build_log_name }}.log
GIST_URL=$(cat gist_url.txt)
echo "gist url: $GIST_URL"
RAW_GIST_URL=$GIST_URL/raw/${{ inputs.issue_num }}_${{ inputs.patch_name }}_${{ inputs.build_log_name }}.log
Expand All @@ -73,14 +84,12 @@ runs:
continue-on-error: true

- name: Build stderr report gist
if: ${{ inputs.build_status == 'failure' }}
if: ${{ steps.preview.outcome == 'success' }}
id: stderr-gist-url
shell: bash
working-directory: riscv-gnu-toolchain
run: |
ONE_MB_IN_BYTES=1048000
tail -c $ONE_MB_IN_BYTES build/${{ inputs.build_log_name }}-stderr.log >> gist.md
python3 ./scripts/create_gist.py --token ${{ inputs.gist_token }} --input gist.md --output gist_url.txt --title ${{ inputs.issue_num }}_${{ inputs.patch_name }}_${{ inputs.build_log_name }}-stderr.log
python3 ./scripts/create_gist.py --token ${{ inputs.gist_token }} --input "$RUNNER_TEMP/build-preview/stderr.txt" --output gist_url.txt --title ${{ inputs.issue_num }}_${{ inputs.patch_name }}_${{ inputs.build_log_name }}-stderr.log
GIST_URL=$(cat gist_url.txt)
echo "gist url: $GIST_URL"
RAW_GIST_URL=$GIST_URL/raw/${{ inputs.issue_num }}_${{ inputs.patch_name }}_${{ inputs.build_log_name }}-stderr.log
Expand All @@ -92,9 +101,16 @@ runs:
if: ${{ inputs.build_status == 'failure' }}
shell: bash
working-directory: riscv-gnu-toolchain
env:
LOG_NAME: ${{ inputs.build_log_name }}
STDOUT_URL: ${{ steps.tail-gist-url.outputs.gist_url }}
STDERR_URL: ${{ steps.stderr-gist-url.outputs.gist_url }}
run: |
if [ '${{ inputs.build_only }}' == 'true' ]; then export HASH=${{ inputs.tot_hash }}; else export HASH=${{ inputs.baseline_hash }}; fi
python scripts/update_issue_status.py -token ${{ inputs.github_token }} -state 'Build failure. Please check the ${{ inputs.build_log_name }} artifact. [Tail Preview (1MB)](${{ steps.tail-gist-url.outputs.gist_url }}), [Stderr preview](${{ steps.stderr-gist-url.outputs.gist_url }})' -comment ${{ inputs.build_comment_id }} -target ${{ inputs.target }} -check 'Build GCC' -repo '${{ inputs.repository }}' -baseline $HASH
state="Build failure. See the $LOG_NAME artifact in [this run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)."
if [[ -n "$STDOUT_URL" ]]; then state+=" [Tail preview]($STDOUT_URL)"; fi
if [[ -n "$STDERR_URL" ]]; then state+=" [Stderr preview]($STDERR_URL)"; fi
python scripts/update_issue_status.py -token ${{ inputs.github_token }} -state "$state" -comment ${{ inputs.build_comment_id }} -target ${{ inputs.target }} -check 'Build GCC' -repo '${{ inputs.repository }}' -baseline $HASH
printf "\n[Additional information](${{ inputs.additional_info }})\n" >> comment.md

- name: Update build complete report comment
Expand All @@ -121,11 +137,11 @@ runs:
shell: bash
working-directory: riscv-gnu-toolchain
run: |
python scripts/post_check_to_patchworks.py -event ${{ github.event_name }} -repo '${{ inputs.repository }}' -pid $(tail -n 1 patches/${{ inputs.patch_name }}) -desc 'Build failed' -iid '${{ inputs.issue_num }}#issuecomment-${{ inputs.build_comment_id }}' -state 'fail' -context 'build--${{ inputs.target }}' -token '${{ inputs.patchwork_token }}'
python scripts/post_check_to_patchworks.py -event ${{ github.event_name }} -repo '${{ inputs.repository }}' -pid '${{ inputs.patch_id }}' -desc 'Build failed' -iid '${{ inputs.issue_num }}#issuecomment-${{ inputs.build_comment_id }}' -state 'fail' -context 'build--${{ inputs.target }}' -token '${{ inputs.patchwork_token }}'

- name: Report build success
if: ${{ inputs.build_status == 'success' && github.workflow != 'Staging' }}
shell: bash
working-directory: riscv-gnu-toolchain
run: |
python scripts/post_check_to_patchworks.py -event ${{ github.event_name }} -repo '${{ inputs.repository }}' -pid $(tail -n 1 patches/${{ inputs.patch_name }}) -desc 'Build passed' -iid '${{ inputs.issue_num }}#issuecomment-${{ inputs.build_comment_id }}' -state 'success' -context 'build--${{ inputs.target }}' -token '${{ inputs.patchwork_token }}'
python scripts/post_check_to_patchworks.py -event ${{ github.event_name }} -repo '${{ inputs.repository }}' -pid '${{ inputs.patch_id }}' -desc 'Build passed' -iid '${{ inputs.issue_num }}#issuecomment-${{ inputs.build_comment_id }}' -state 'success' -context 'build--${{ inputs.target }}' -token '${{ inputs.patchwork_token }}'
4 changes: 0 additions & 4 deletions .github/workflows/call-patchworks-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -123,7 +122,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -155,7 +153,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -186,7 +183,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Python dependencies
run: |
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/downtime-runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -101,7 +100,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -141,7 +139,7 @@ jobs:
id: list_patches
run: |
if [ -f ./artifact_names.txt ]; then
export PATCHLIST="$(cat artifact_names.txt)"
PATCHLIST=$(python ../scripts/patch_matrix.py)
else
export PATCHLIST='[]'
fi
Expand All @@ -166,20 +164,20 @@ jobs:
retention-days: 90

outputs:
list_of_patch_names: ${{ steps.list_patches.outputs.patch_list }}
patch_targets: ${{ steps.list_patches.outputs.patch_list }}
end_date: ${{ steps.timestamps.outputs.end_date }}

init-submodules:
needs: [check_last_runner, fetch_patches]
if: ${{ needs.fetch_patches.outputs.list_of_patch_names != '[]' }}
if: ${{ needs.fetch_patches.outputs.patch_targets != '[]' }}
uses: ./.github/workflows/init-submodules.yaml
secrets: inherit

checkpoint:
needs: [check_last_runner, fetch_patches, init-submodules, patch_matrix]
# Empty queues intentionally skip the downstream jobs. Failed or cancelled
# processing must retain the old checkpoint so the next scan can retry it.
if: ${{ !cancelled() && needs.check_last_runner.result == 'success' && needs.fetch_patches.result == 'success' && (needs.fetch_patches.outputs.list_of_patch_names == '[]' || (needs.init-submodules.result == 'success' && needs.patch_matrix.result == 'success')) }}
if: ${{ !cancelled() && needs.check_last_runner.result == 'success' && needs.fetch_patches.result == 'success' && (needs.fetch_patches.outputs.patch_targets == '[]' || (needs.init-submodules.result == 'success' && needs.patch_matrix.result == 'success')) }}
runs-on: ubuntu-24.04
permissions:
contents: read
Expand All @@ -204,14 +202,15 @@ jobs:
strategy:
fail-fast: false
matrix:
patch_name: ${{ fromJSON(needs.fetch_patches.outputs.list_of_patch_names) }}
include: ${{ fromJSON(needs.fetch_patches.outputs.patch_targets) }}
uses: ./.github/workflows/run-checks.yaml
permissions:
actions: read
contents: read
issues: write
with:
patch_name: ${{ matrix.patch_name }}
patch_id: ${{ matrix.patch_id }}
baseline_hash: ${{ needs.init-submodules.outputs.baseline_hash }}
tot_hash: ${{ needs.init-submodules.outputs.tot_hash }}
secrets: inherit
Loading
Loading