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
36 changes: 15 additions & 21 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@ run-name: Build Artifacts ${{ github.actor }} ${{ github.event_name }} (${{ inpu
on:
push:
branches: [ main ]
paths-ignore:
- '.github/**'
- 'scripts/**'
- '.gitattributes'
- '.gitignore'
- '**/*.md'
- '**/*.txt'
- '**/*.jar'
- 'LICENSE'
- 'NOTICE'
- 'gradlew'
- 'gradlew.bat'
- 'src/bindings-*/**/bench/**'
- 'src/bindings-*/examples/**'
- 'src/bindings-*/tests/**'
- 'src/bindings-jvm/version.properties'
- 'src/bindings-wasm/dist/*'
- 'src/bindings-python/generated/**'
- 'src/bindings-go/go/internal/**'
- 'src/bindings-go/go/libs/**'
- 'release-bin/*'
workflow_dispatch:
inputs:
branch:
Expand All @@ -41,10 +20,25 @@ permissions:
contents: read

jobs:
relevant-changes:
uses: ./.github/workflows/relevant-source-changes.yml
permissions:
contents: read
pull-requests: read

build-required:
needs: [ relevant-changes ]
if: ${{ needs.relevant-changes.outputs.relevant == 'true' }}
runs-on: ubuntu-latest
steps:
- run: echo "Artifact build required"

get-configs:
needs: [ build-required ]
uses: ./.github/workflows/configs.yml

resolve-ref:
needs: [ build-required ]
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.head.outputs.sha }}
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/performance-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Performance Regression

on:
workflow_call:
inputs:
base_ref:
description: Git ref to use as the performance baseline
required: false
default: origin/main
type: string
head_ref:
description: Git ref to test
required: false
default: ''
type: string
workflow_dispatch:
inputs:
base_ref:
description: Git ref to use as the performance baseline
required: false
default: origin/main
type: string
head_ref:
description: Git ref to test
required: false
default: ''
type: string

permissions:
contents: read

concurrency:
group: performance-regression-${{ github.ref }}
cancel-in-progress: true

jobs:
get-configs:
uses: ./.github/workflows/configs.yml

compare:
name: Compare base and head
needs: [get-configs]
runs-on: ubuntu-latest
timeout-minutes: 35
env:
BASE_REF: ${{ inputs.base_ref || 'origin/main' }}
HEAD_REF: ${{ inputs.head_ref || github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install Rust ${{ needs.get-configs.outputs.rust-toolchain }}
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c
with:
toolchain: ${{ needs.get-configs.outputs.rust-toolchain }}

- name: Setup Python ${{ needs.get-configs.outputs.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ needs.get-configs.outputs.python-version }}

- name: Test comparison logic
run: python3 scripts/check_performance_regression.py --self-test

- name: Compare performance
run: |
set -euo pipefail
python3 scripts/check_performance_regression.py \
--base-ref "$BASE_REF" \
--head-ref "$HEAD_REF" \
--output-dir "$RUNNER_TEMP/performance-regression"

- name: Add comparison to job summary
if: always()
run: |
if [[ -f "$RUNNER_TEMP/performance-regression/performance-comparison.md" ]]; then
cat "$RUNNER_TEMP/performance-regression/performance-comparison.md" >> "$GITHUB_STEP_SUMMARY"
fi

- name: Upload performance evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: performance-regression-${{ github.event.pull_request.number || github.run_id }}
path: |
${{ runner.temp }}/performance-regression/performance-comparison.json
${{ runner.temp }}/performance-regression/performance-comparison.md
if-no-files-found: warn
retention-days: 7
16 changes: 16 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ concurrency:
cancel-in-progress: true

jobs:
relevant-changes:
uses: ./.github/workflows/relevant-source-changes.yml
permissions:
contents: read
pull-requests: read

validate:
uses: ./.github/workflows/validate.yml
permissions:
Expand All @@ -21,3 +27,13 @@ jobs:
with:
ref: ${{ github.sha }}
release-run: false

performance-regression:
needs: [relevant-changes]
if: ${{ needs.relevant-changes.outputs.relevant == 'true' }}
uses: ./.github/workflows/performance-regression.yml
permissions:
contents: read
with:
base_ref: ${{ github.event.pull_request.base.sha }}
head_ref: ${{ github.event.pull_request.head.sha }}
64 changes: 64 additions & 0 deletions .github/workflows/relevant-source-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Relevant Source Changes

on:
workflow_call:
outputs:
relevant:
description: Whether at least one changed path requires artifact or performance validation
value: ${{ jobs.changes.outputs.relevant }}

permissions:
contents: read
pull-requests: read

jobs:
changes:
runs-on: ubuntu-latest
outputs:
relevant: ${{ steps.decision.outputs.relevant }}
steps:
- name: Checkout push history
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Detect relevant paths
if: ${{ github.event_name != 'workflow_dispatch' }}
id: filter
uses: dorny/paths-filter@v4.0.3
with:
filters: |
relevant:
- '**'
- '!.github/**'
- '!scripts/**'
- '!.gitattributes'
- '!.gitignore'
- '!**/*.md'
- '!**/*.txt'
- '!**/*.jar'
- '!LICENSE'
- '!NOTICE'
- '!gradlew'
- '!gradlew.bat'
- '!src/bindings-*/**/bench/**'
- '!src/bindings-*/examples/**'
- '!src/bindings-*/tests/**'
- '!src/bindings-jvm/version.properties'
- '!src/bindings-wasm/dist/*'
- '!src/bindings-python/generated/**'
- '!src/bindings-go/go/internal/**'
- '!src/bindings-go/go/libs/**'
- '!release-bin/*'

- name: Export decision
id: decision
env:
FILTER_RELEVANT: ${{ steps.filter.outputs.relevant }}
run: |
if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" || "$FILTER_RELEVANT" == "true" ]]; then
echo "relevant=true" >> "$GITHUB_OUTPUT"
else
echo "relevant=false" >> "$GITHUB_OUTPUT"
fi
Loading
Loading