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
24 changes: 15 additions & 9 deletions .github/workflows/llgo-binary-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,37 @@ jobs:
contents: read
runs-on: ubuntu-24.04
outputs:
version_changed: ${{ steps.changed.outputs.version_changed }}
full_matrix: ${{ steps.changed.outputs.full_matrix }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect a committed LLGo version change
- name: Detect an LLGo pin or benchmark-case change
id: changed
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail
if git diff --name-only "$BASE_SHA" "$PR_SHA" | grep -Fxq 'ci/llgo-size/llgo-version.env'; then
echo 'version_changed=true' >> "$GITHUB_OUTPUT"
echo 'The PR changes the committed LLGo version; the full matrix will run.'
if git diff --quiet "$BASE_SHA" "$PR_SHA" -- \
ci/llgo-size/llgo-version.env \
ci/llgo-size/bin/go \
cmd/bent \
cmd/bent/configs/benchmarks-llgo-size.toml \
cmd/bent/configs/configurations-llgo-size.toml \
cmd/bent/configs/suites.toml; then
echo 'full_matrix=false' >> "$GITHUB_OUTPUT"
echo 'The PR does not change the LLGo pin, Bent, or benchmark cases; only Go validation will run.'
else
echo 'version_changed=false' >> "$GITHUB_OUTPUT"
echo 'The PR does not change the committed LLGo version; only Go validation will run.'
echo 'full_matrix=true' >> "$GITHUB_OUTPUT"
echo 'The PR changes the LLGo pin, Bent, or benchmark cases; the full matrix will run without publishing.'
fi

binary-size:
if: >-
always() && github.event_name != 'repository_dispatch' &&
(github.event_name != 'pull_request' || needs.pr-scope.outputs.version_changed == 'true')
(github.event_name != 'pull_request' || needs.pr-scope.outputs.full_matrix == 'true')
needs: pr-scope
permissions:
contents: write
Expand Down Expand Up @@ -297,7 +303,7 @@ jobs:
pr-validation:
if: >-
always() && github.event_name == 'pull_request' &&
needs.pr-scope.result == 'success' && needs.pr-scope.outputs.version_changed != 'true'
needs.pr-scope.result == 'success' && needs.pr-scope.outputs.full_matrix != 'true'
needs: pr-scope
permissions:
contents: read
Expand Down
12 changes: 6 additions & 6 deletions ci/llgo-size/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ The benchmark and page-only workflows use separate concurrency queues. A page
refresh can therefore wait independently without replacing a pending
binary-size run.

Pull requests are split by whether they change `llgo-version.env`. A normal PR
uses a separate Go-only validation job: dependency acquisition, compilation,
and execution are checked without building LLGo or the four LLGo binary-size
variants. A PR that changes the committed LLGo version runs the full five-way
matrix and uploads the `llgo-binary-size` artifact for review, but still does
not publish history.
Pull requests that change the committed LLGo version, Bent, the LLGo-size
benchmark/configuration files, or the suite definitions used by those cases
run the full five-way matrix and upload the `llgo-binary-size` artifact for
review. They do not publish history. A PR outside that scope uses the separate
Go-only validation job, so dependency acquisition, compilation, and execution
remain checked without rebuilding LLGo or the four LLGo binary-size variants.

Published history is keyed by the full LLGo commit, so rerunning one commit
updates its existing entry instead of adding another build-round entry.
Expand Down
Loading
Loading