|
| 1 | +name: Native stress |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - "src/ml4t/engineer/features/**" |
| 8 | + - "src/ml4t/engineer/core/**" |
| 9 | + - "tests/features/**" |
| 10 | + - "tests/test_all_features_integration.py" |
| 11 | + - "scripts/ci/**" |
| 12 | + - ".github/workflows/ci.yml" |
| 13 | + - ".github/workflows/native-stress.yml" |
| 14 | + - "pyproject.toml" |
| 15 | + - "uv.lock" |
| 16 | + push: |
| 17 | + branches: [main] |
| 18 | + paths: |
| 19 | + - "src/ml4t/engineer/features/**" |
| 20 | + - "src/ml4t/engineer/core/**" |
| 21 | + - "tests/features/**" |
| 22 | + - "tests/test_all_features_integration.py" |
| 23 | + - "scripts/ci/**" |
| 24 | + - ".github/workflows/ci.yml" |
| 25 | + - ".github/workflows/native-stress.yml" |
| 26 | + - "pyproject.toml" |
| 27 | + - "uv.lock" |
| 28 | + schedule: |
| 29 | + - cron: "17 5 * * 1" |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +permissions: |
| 33 | + contents: read |
| 34 | + |
| 35 | +concurrency: |
| 36 | + group: native-stress-${{ github.ref }} |
| 37 | + cancel-in-progress: true |
| 38 | + |
| 39 | +jobs: |
| 40 | + build: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 20 |
| 43 | + outputs: |
| 44 | + matrix: ${{ steps.matrix.outputs.matrix }} |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 47 | + with: |
| 48 | + fetch-depth: 0 |
| 49 | + persist-credentials: false |
| 50 | + - uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 |
| 51 | + with: |
| 52 | + version: "0.10.9" |
| 53 | + - run: uv sync --python 3.12 --dev |
| 54 | + - run: uv build --out-dir native-candidate/dist |
| 55 | + - name: Bind the stress artifact to the tested revision |
| 56 | + run: >- |
| 57 | + uv run python scripts/ci/candidate.py create native-candidate |
| 58 | + --commit-sha "${{ github.sha }}" |
| 59 | + --git-tree "$(git rev-parse 'HEAD^{tree}')" |
| 60 | + - id: matrix |
| 61 | + run: uv run python scripts/ci/native_stress.py --matrix >> "$GITHUB_OUTPUT" |
| 62 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 63 | + with: |
| 64 | + name: native-stress-candidate |
| 65 | + path: native-candidate/ |
| 66 | + if-no-files-found: error |
| 67 | + |
| 68 | + stress: |
| 69 | + name: Native stress (${{ matrix.os }}, Python ${{ matrix.python-version }}) |
| 70 | + runs-on: ${{ matrix.os }} |
| 71 | + needs: build |
| 72 | + timeout-minutes: ${{ matrix.python-version == '3.15' && 90 || 30 }} |
| 73 | + strategy: |
| 74 | + fail-fast: false |
| 75 | + matrix: ${{ fromJSON(needs.build.outputs.matrix) }} |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 78 | + with: |
| 79 | + fetch-depth: 0 |
| 80 | + persist-credentials: false |
| 81 | + - uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 |
| 82 | + with: |
| 83 | + version: "0.10.9" |
| 84 | + cache-suffix: python-${{ matrix.python-version }} |
| 85 | + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 |
| 86 | + with: |
| 87 | + python-version: ${{ matrix.python-version }} |
| 88 | + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 |
| 89 | + with: |
| 90 | + name: native-stress-candidate |
| 91 | + path: native-candidate |
| 92 | + - name: Verify stress artifact identity |
| 93 | + shell: bash |
| 94 | + run: >- |
| 95 | + python scripts/ci/candidate.py verify native-candidate |
| 96 | + --expected-commit "${{ github.sha }}" |
| 97 | + --expected-tree "$(git rev-parse 'HEAD^{tree}')" |
| 98 | + - name: Install the built wheel with locked test dependencies |
| 99 | + shell: bash |
| 100 | + run: | |
| 101 | + uv export --locked --group dev --extra ta --extra store --extra viz \ |
| 102 | + --no-emit-project --no-hashes --output-file "${{ runner.temp }}/stress-requirements.txt" |
| 103 | + uv venv --python python .artifact-venv |
| 104 | + wheel="$(find native-candidate/dist -maxdepth 1 -name '*.whl' -print -quit)" |
| 105 | + UV_CACHE_DIR="${{ runner.temp }}/fresh-wheel-cache" \ |
| 106 | + uv pip install --python .artifact-venv "$wheel" |
| 107 | + uv pip install --python .artifact-venv \ |
| 108 | + --requirements "${{ runner.temp }}/stress-requirements.txt" |
| 109 | + - name: Verify actual installed origin and bytes |
| 110 | + shell: bash |
| 111 | + run: >- |
| 112 | + uv run --python .artifact-venv --no-project |
| 113 | + python scripts/ci/candidate.py verify-installed native-candidate --source-root src |
| 114 | + - name: Run fresh-process native and cold-call regressions |
| 115 | + shell: bash |
| 116 | + run: >- |
| 117 | + uv run --python .artifact-venv --no-project |
| 118 | + python scripts/ci/native_stress.py --repetitions 10 |
0 commit comments