-
Notifications
You must be signed in to change notification settings - Fork 1.7k
65 lines (54 loc) · 2.14 KB
/
experiment.yaml
File metadata and controls
65 lines (54 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Next-Gen CI Prototype
on:
pull_request:
branches: [ main ]
# 1. CONCURRENCY: Stop burning money on abandoned commits
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
discover:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.changes.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect Changed Packages
id: changes
uses: tj-actions/changed-files@v44
with:
files: packages/** # Only watch the packages directory
dir_names: true # Return folder names, not files
dir_names_max_depth: 2 # Strip it down to just "google-cloud-storage"
json: true # Output a perfect JSON array for the matrix
escape_json: false
# 3. EXECUTION: Native Fan-out Matrix
unit-test:
needs: discover
if: ${{ needs.discover.outputs.packages != '[]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false # Don't kill the whole matrix if one package fails
matrix:
package: ${{ fromJSON(needs.discover.outputs.packages) }}
# Risk-Tiering: Smoke test on presubmit to save money
python: ["3.11"]
steps:
- uses: actions/checkout@v4
# 4. THE ENGINE SWAP: Rust-based uv instead of setup-python + pip
- name: Install uv and Python
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python }}
enable-cache: true
cache-dependency-glob: "packages/${{ matrix.package }}/setup.py"
- name: Execute Tests (High-Density)
run: |
cd packages/${{ matrix.package }}
# Force Nox to natively use uv instead of the legacy virtualenv module
export NOX_DEFAULT_VENV_BACKEND=uv
echo "Running targeted tests for ${{ matrix.package }} on Python ${{ matrix.python }}"
# Use uvx to run nox (with the uv plugin injected to guarantee compatibility)
uvx --with 'nox[uv]' nox -s unit-${{ matrix.python }}