|
5 | 5 | branches: [main] |
6 | 6 | pull_request: |
7 | 7 | branches: [main] |
8 | | - schedule: |
9 | | - - cron: "0 5 1,15 * *" |
10 | 8 |
|
11 | 9 | concurrency: |
12 | 10 | group: ${{ github.workflow }}-${{ github.ref }} |
13 | 11 | cancel-in-progress: true |
14 | 12 |
|
15 | 13 | jobs: |
16 | 14 | test: |
17 | | - runs-on: ${{ matrix.os }} |
18 | | - defaults: |
19 | | - run: |
20 | | - shell: bash -e {0} # -e to fail on error |
21 | | - |
| 15 | + runs-on: ubuntu-latest |
22 | 16 | strategy: |
23 | 17 | fail-fast: false |
24 | 18 | matrix: |
25 | | - python: ["3.10", "3.11", "3.12"] |
26 | | - os: [ubuntu-latest] |
27 | | - |
| 19 | + python: ["3.11", "3.12"] |
28 | 20 | env: |
29 | | - OS: ${{ matrix.os }} |
30 | | - PYTHON: ${{ matrix.python }} |
31 | | - |
| 21 | + JAX_PLATFORM_NAME: cpu |
| 22 | + MPLBACKEND: Agg |
32 | 23 | steps: |
33 | | - - uses: actions/checkout@v3 |
34 | | - - name: Set up Python ${{ matrix.python }} |
35 | | - uses: actions/setup-python@v4 |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + - uses: actions/setup-python@v5 |
36 | 26 | with: |
37 | 27 | python-version: ${{ matrix.python }} |
38 | | - cache: "pip" |
39 | | - cache-dependency-path: "**/pyproject.toml" |
| 28 | + - uses: astral-sh/setup-uv@v5 |
| 29 | + with: |
| 30 | + enable-cache: true |
| 31 | + - run: uv sync --locked --group test |
| 32 | + - run: uv run pytest |
| 33 | + |
| 34 | + clean-import: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: "3.11" |
| 41 | + - uses: astral-sh/setup-uv@v5 |
| 42 | + - run: uv venv /tmp/perturbo-base |
| 43 | + - run: uv pip install --python /tmp/perturbo-base/bin/python . |
| 44 | + - run: >- |
| 45 | + /tmp/perturbo-base/bin/python -c |
| 46 | + "import sys; import perturbo; |
| 47 | + assert all(name not in sys.modules for name in ('torch', 'pyro', 'scvi'))" |
40 | 48 |
|
41 | | - - name: Install test dependencies |
42 | | - run: | |
43 | | - python -m pip install --upgrade pip wheel |
44 | | - - name: Install dependencies |
45 | | - run: | |
46 | | - pip install ".[dev,test]" |
47 | | - - name: Test |
48 | | - env: |
49 | | - MPLBACKEND: agg |
50 | | - PLATFORM: ${{ matrix.os }} |
51 | | - DISPLAY: :42 |
52 | | - run: | |
53 | | - coverage run -m pytest -v --color=yes |
54 | | - - name: Report coverage |
55 | | - run: | |
56 | | - coverage report |
57 | | - - name: Upload coverage |
58 | | - uses: codecov/codecov-action@v3 |
| 49 | + legacy: |
| 50 | + runs-on: ubuntu-latest |
| 51 | + env: |
| 52 | + JAX_PLATFORM_NAME: cpu |
| 53 | + MPLBACKEND: Agg |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v4 |
| 56 | + - uses: actions/setup-python@v5 |
| 57 | + with: |
| 58 | + python-version: "3.11" |
| 59 | + - uses: astral-sh/setup-uv@v5 |
59 | 60 | with: |
60 | | - token: ${{ secrets.CODECOV_TOKEN }} |
| 61 | + enable-cache: true |
| 62 | + - run: uv sync --locked --group test --extra legacy |
| 63 | + - run: uv run pytest tests/legacy |
0 commit comments