mirror of
https://github.com/trailofbits/buttercup
synced 2026-06-21 14:11:39 +00:00
2ddae66040
Bumps the actions group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `6.0.2` | `6.0.3` | | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `8.1.0` | `8.2.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.0.0` | `4.1.0` | | [docker/login-action](https://github.com/docker/login-action) | `4.1.0` | `4.2.0` | | [docker/metadata-action](https://github.com/docker/metadata-action) | `6.0.0` | `6.1.0` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `7.1.0` | `7.2.0` | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `6.0.1` | `7.0.0` | Updates `actions/checkout` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) Updates `astral-sh/setup-uv` from 8.1.0 to 8.2.0 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/08807647e7069bb48b6ef5acd8ec9567f424441b...fac544c07dec837d0ccb6301d7b5580bf5edae39) Updates `docker/setup-buildx-action` from 4.0.0 to 4.1.0 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd...d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5) Updates `docker/login-action` from 4.1.0 to 4.2.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/4907a6ddec9925e35a0a9e82d7399ccc52663121...650006c6eb7dba73a995cc03b0b2d7f5ca915bee) Updates `docker/metadata-action` from 6.0.0 to 6.1.0 - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/030e881283bb7a6894de51c315a6bfe6a94e05cf...80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9) Updates `docker/build-push-action` from 7.1.0 to 7.2.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/bcafcacb16a39f128d818304e6c9c0c18556b85f...f9f3042f7e2789586610d6e8b85c8f03e5195baf) Updates `codecov/codecov-action` from 6.0.1 to 7.0.0 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/e79a6962e0d4c0c17b229090214935d2e33f8354...fb8b3582c8e4def4969c97caa2f19720cb33a72f) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: astral-sh/setup-uv dependency-version: 8.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/setup-buildx-action dependency-version: 4.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/login-action dependency-version: 4.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/metadata-action dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/build-push-action dependency-version: 7.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
209 lines
7.7 KiB
YAML
209 lines
7.7 KiB
YAML
name: Component Integration Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# Always run full test suite on main branch
|
|
pull_request:
|
|
|
|
schedule:
|
|
# Run integration tests daily at 2 AM UTC
|
|
- cron: '0 2 * * *'
|
|
workflow_dispatch:
|
|
inputs:
|
|
components:
|
|
description: 'Components to test (comma-separated: common,patcher,program-model,seed-gen)'
|
|
required: false
|
|
default: 'common,patcher,program-model,seed-gen'
|
|
type: string
|
|
run_integration:
|
|
description: 'Run integration tests'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# Integration tests - run on schedule, manual trigger, or labeled PRs
|
|
test-integration:
|
|
permissions:
|
|
contents: read
|
|
# Run if:
|
|
# - Scheduled run
|
|
# - Manual dispatch with run_integration=true
|
|
# - Push to main branch
|
|
# - PR with 'integration-tests' label
|
|
if: |
|
|
github.event_name == 'schedule' ||
|
|
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_integration == 'true') ||
|
|
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
|
|
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'integration-tests'))
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- component: common
|
|
coverage_module: buttercup.common
|
|
python: "3.12"
|
|
- component: patcher
|
|
coverage_module: buttercup.patcher
|
|
python: "3.12"
|
|
- component: program-model
|
|
coverage_module: buttercup.program_model
|
|
python: "3.12"
|
|
- component: seed-gen
|
|
coverage_module: buttercup.seed_gen
|
|
python: "3.12"
|
|
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
redis:
|
|
image: redis@sha256:e647cfe134bf5e8e74e620f66346f93418acfc240b71dd85640325cb7cd01402 # 7.4
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 6379:6379
|
|
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
submodules: true
|
|
|
|
- name: Check if component should be tested
|
|
id: should_test
|
|
if: github.event_name == 'workflow_dispatch'
|
|
env:
|
|
INPUT_COMPONENTS: ${{ github.event.inputs.components }}
|
|
MATRIX_COMPONENT: ${{ matrix.component }}
|
|
run: |
|
|
if [[ -z "$INPUT_COMPONENTS" ]] || [[ "$INPUT_COMPONENTS" == *"$MATRIX_COMPONENT"* ]]; then
|
|
echo "test=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "test=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Install uv
|
|
if: steps.should_test.outputs.test != 'false'
|
|
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
|
|
- name: Setup uv cache
|
|
if: steps.should_test.outputs.test != 'false'
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: |
|
|
~/.cache/uv
|
|
~/.local/share/uv
|
|
key: ${{ runner.os }}-uv-integration-${{ matrix.component }}-${{ hashFiles(format('{0}/uv.lock', matrix.component)) }}
|
|
restore-keys: |
|
|
${{ runner.os }}-uv-integration-${{ matrix.component }}-
|
|
${{ runner.os }}-uv-
|
|
|
|
- name: Download Wasm runtime
|
|
if: matrix.component == 'seed-gen' && steps.should_test.outputs.test != 'false'
|
|
run: wget https://github.com/vmware-labs/webassembly-language-runtimes/releases/download/python%2F3.12.0%2B20231211-040d5a6/python-3.12.0.wasm
|
|
working-directory: seed-gen
|
|
|
|
- name: Install integration test dependencies
|
|
if: steps.should_test.outputs.test != 'false'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y codequery ripgrep
|
|
make install-cscope
|
|
|
|
- name: Prepare environment
|
|
if: steps.should_test.outputs.test != 'false'
|
|
run: |
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
sudo apt-get update
|
|
sudo mkdir -p /crs_scratch
|
|
sudo chmod -R 777 /crs_scratch
|
|
|
|
- name: Setup ${{ matrix.component }} component
|
|
if: steps.should_test.outputs.test != 'false'
|
|
run: |
|
|
uv sync --all-extras --frozen
|
|
uv pip install 'pytest-html>=4.1.1' 'pytest-cov>=6.0.0'
|
|
working-directory: ${{ matrix.component }}
|
|
|
|
- name: Run program-model libpng integration test
|
|
if: matrix.component == 'program-model' && steps.should_test.outputs.test != 'false'
|
|
run: |
|
|
uv run --frozen pytest -svv --runintegration tests/c/test_libpng.py \
|
|
--junit-xml=integration-test-results.xml \
|
|
--html=integration-test-report.html \
|
|
--self-contained-html \
|
|
--cov=${{ matrix.coverage_module }} \
|
|
--cov-report=xml:integration-coverage.xml \
|
|
--cov-report=html:integration-htmlcov \
|
|
--cov-report=term
|
|
env:
|
|
PYTHON_WASM_BUILD_PATH: "python-3.12.0.wasm"
|
|
working-directory: ${{ matrix.component }}
|
|
timeout-minutes: 30
|
|
|
|
- name: Run integration tests on ${{ matrix.component }}
|
|
if: matrix.component != 'program-model' && steps.should_test.outputs.test != 'false'
|
|
run: |
|
|
uv run --frozen pytest -svv --runintegration \
|
|
--junit-xml=integration-test-results.xml \
|
|
--html=integration-test-report.html \
|
|
--self-contained-html \
|
|
--cov=${{ matrix.coverage_module }} \
|
|
--cov-report=xml:integration-coverage.xml \
|
|
--cov-report=html:integration-htmlcov \
|
|
--cov-report=term
|
|
env:
|
|
PYTHON_WASM_BUILD_PATH: "python-3.12.0.wasm"
|
|
working-directory: ${{ matrix.component }}
|
|
timeout-minutes: 30
|
|
|
|
- name: Generate integration test summary
|
|
if: always() && steps.should_test.outputs.test != 'false'
|
|
env:
|
|
COMPONENT: ${{ matrix.component }}
|
|
run: |
|
|
echo "### Integration Test Results: ${COMPONENT}" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ -f "${COMPONENT}/integration-test-results.xml" ]; then
|
|
python -c "
|
|
import xml.etree.ElementTree as ET
|
|
import os
|
|
tree = ET.parse(os.environ['COMPONENT'] + '/integration-test-results.xml')
|
|
root = tree.getroot()
|
|
tests = root.get('tests', '0')
|
|
failures = root.get('failures', '0')
|
|
errors = root.get('errors', '0')
|
|
skipped = root.get('skipped', '0')
|
|
time = root.get('time', '0')
|
|
print(f'- **Total Tests**: {tests}')
|
|
print(f'- **Passed**: {int(tests) - int(failures) - int(errors) - int(skipped)}')
|
|
print(f'- **Failed**: {failures}')
|
|
print(f'- **Errors**: {errors}')
|
|
print(f'- **Skipped**: {skipped}')
|
|
print(f'- **Duration**: {float(time):.2f}s')
|
|
" >> "$GITHUB_STEP_SUMMARY"
|
|
else
|
|
echo "No integration test results found" >> "$GITHUB_STEP_SUMMARY"
|
|
fi
|
|
|
|
- name: Upload integration test results
|
|
if: always() && steps.should_test.outputs.test != 'false'
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: integration-test-results-${{ matrix.component }}-py${{ matrix.python }}
|
|
path: |
|
|
${{ matrix.component }}/integration-test-results.xml
|
|
${{ matrix.component }}/integration-test-report.html
|
|
${{ matrix.component }}/integration-coverage.xml
|
|
${{ matrix.component }}/integration-htmlcov/
|
|
retention-days: 30
|