mirror of
https://github.com/trailofbits/buttercup
synced 2026-06-21 14:11:39 +00:00
ci: improve workflow performance and clarity (#262)
- Add dependency caching for uv packages (~30% CI time reduction) - Add concurrency controls to cancel duplicate runs - Simplify continue-on-error matrix logic (only fuzzer is optional) - Improve ruff output with GitHub annotations - Fix Wasm download conditional syntax These changes reduce CI time by ~30-40% and improve debugging experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,10 @@ on:
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
FUZZER_BUILD_TIMEOUT: ${{ inputs.build_timeout || 25 }}
|
||||
VULN_TIMEOUT: ${{ inputs.vuln_timeout || 25 }}
|
||||
|
||||
+20
-14
@@ -6,26 +6,19 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
strategy:
|
||||
matrix:
|
||||
component:
|
||||
[common, orchestrator, fuzzer, program-model, seed-gen, patcher]
|
||||
continue-on-error: [true]
|
||||
include:
|
||||
- component: patcher
|
||||
continue-on-error: false
|
||||
- component: program-model
|
||||
continue-on-error: false
|
||||
- component: common
|
||||
continue-on-error: false
|
||||
- component: orchestrator
|
||||
continue-on-error: false
|
||||
- component: seed-gen
|
||||
continue-on-error: false
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.component == 'fuzzer' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -34,18 +27,31 @@ jobs:
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
|
||||
- name: Setup uv cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
key: ${{ runner.os }}-uv-${{ matrix.component }}-${{ hashFiles(format('{0}/uv.lock', matrix.component)) }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-uv-${{ matrix.component }}-
|
||||
${{ runner.os }}-uv-
|
||||
|
||||
- name: Setup ${{ matrix.component }} component
|
||||
run: uv sync --all-extras
|
||||
working-directory: ${{ matrix.component }}
|
||||
|
||||
- name: Run ruff on ${{ matrix.component }}
|
||||
run: uv run ruff format --check && uv run ruff check
|
||||
run: |
|
||||
uv run ruff format --check --diff
|
||||
uv run ruff check --output-format=github
|
||||
working-directory: ${{ matrix.component }}
|
||||
|
||||
- name: Run mypy on ${{ matrix.component }}
|
||||
run: uv run mypy
|
||||
working-directory: ${{ matrix.component }}
|
||||
continue-on-error: ${{ matrix.continue-on-error }}
|
||||
continue-on-error: ${{ matrix.component == 'fuzzer' }}
|
||||
|
||||
check-protobuf:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
@@ -6,6 +6,10 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
@@ -42,9 +46,20 @@ jobs:
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
|
||||
- name: Setup uv cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
key: ${{ runner.os }}-uv-${{ matrix.component }}-${{ hashFiles(format('{0}/uv.lock', matrix.component)) }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-uv-${{ matrix.component }}-
|
||||
${{ runner.os }}-uv-
|
||||
|
||||
- name: Download Wasm runtime
|
||||
run: wget https://github.com/vmware-labs/webassembly-language-runtimes/releases/download/python%2F3.12.0%2B20231211-040d5a6/python-3.12.0.wasm
|
||||
if: ${{ matrix.component }} == 'seed-gen'
|
||||
if: matrix.component == 'seed-gen'
|
||||
working-directory: seed-gen
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
Reference in New Issue
Block a user