mirror of
https://github.com/MG1937/ASC.git
synced 2026-10-02 08:34:55 +08:00
66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
branches: ['**']
|
|
pull_request:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
inputs:
|
|
baseline_sha:
|
|
required: true
|
|
type: string
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
regression:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ['3.11', '3.12']
|
|
steps:
|
|
- uses: actions/checkout@v7.0.1
|
|
- name: Checkout performance baseline
|
|
uses: actions/checkout@v7.0.1
|
|
with:
|
|
repository: ${{ github.event.pull_request.base.repo.full_name || (github.event_name == 'push' && github.ref_name == 'dev-0.1.0' && github.repository) || 'MG1937/ASC' }}
|
|
ref: ${{ inputs.baseline_sha || github.event.pull_request.base.sha || (github.event_name == 'push' && github.ref_name == 'dev-0.1.0' && github.event.before) || 'dev-0.1.0' }}
|
|
path: .performance-base
|
|
- uses: actions/setup-python@v7.0.0
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: pip
|
|
- run: python -m pip install -r requirements.txt
|
|
- run: python -m pip check
|
|
- name: Unit tests (no skips)
|
|
run: python tests/run_tests.py --require-decompiler --suite unit
|
|
- name: Integration tests (no skips)
|
|
run: python tests/run_tests.py --require-decompiler --suite integration
|
|
- name: Reject material performance regressions against the target branch
|
|
run: python tests/benchmark_compare.py --baseline .performance-base --samples 31
|
|
- name: Check cold-process startup with --debug
|
|
run: python tests/benchmark_startup.py --samples 9 --max-total-ms 100 --max-wall-ms 250
|
|
- name: Check supplied DEX benchmarks and 0.0880 s budget
|
|
run: python tests/benchmark_reference.py --samples 9
|
|
- name: Upload benchmark timings and raw debug logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v7.0.1
|
|
with:
|
|
name: benchmarks-python-${{ matrix.python-version }}
|
|
path: |
|
|
artifacts/startup/
|
|
artifacts/reference/
|
|
artifacts/comparison/
|
|
if-no-files-found: warn
|
|
- name: Build source release preview
|
|
if: matrix.python-version == '3.12'
|
|
run: python scripts/build_release.py v0.1.0 --output dist
|
|
- name: Upload source release preview
|
|
if: matrix.python-version == '3.12'
|
|
uses: actions/upload-artifact@v7.0.1
|
|
with:
|
|
name: source-release-preview
|
|
path: dist/
|
|
if-no-files-found: error
|