diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 265a95e..703ed2e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Check Build +name: Build on: push: @@ -14,11 +14,11 @@ jobs: package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" cache: "pip" cache-dependency-path: "**/pyproject.toml" - name: Install build dependencies diff --git a/.github/workflows/test.yaml b/.github/workflows/test_linux.yaml similarity index 65% rename from .github/workflows/test.yaml rename to .github/workflows/test_linux.yaml index c5b152b..d8eda5f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test_linux.yaml @@ -1,12 +1,10 @@ -name: Test +name: Test (Linux) on: push: branches: [main] pull_request: branches: [main] - schedule: - - cron: "0 5 1,15 * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -22,26 +20,19 @@ jobs: strategy: fail-fast: false matrix: - include: - - os: ubuntu-latest - python: "3.9" - - os: ubuntu-latest - python: "3.11" - - os: ubuntu-latest - python: "3.11" - pip-flags: "--pre" - name: PRE-RELEASE DEPENDENCIES + os: [ubuntu-latest] + python: ["3.9", "3.10", "3.11"] - name: ${{ matrix.name }} Python ${{ matrix.python }} + name: Integration env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: "pip" @@ -50,9 +41,11 @@ jobs: - name: Install test dependencies run: | python -m pip install --upgrade pip wheel + - name: Install dependencies run: | - pip install ${{ matrix.pip-flags }} ".[dev,test]" + pip install --pre ".[dev,test]" + - name: Test env: MPLBACKEND: agg @@ -64,4 +57,6 @@ jobs: run: | coverage report - name: Upload coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_linux_cuda.yaml b/.github/workflows/test_linux_cuda.yaml new file mode 100644 index 0000000..25211b6 --- /dev/null +++ b/.github/workflows/test_linux_cuda.yaml @@ -0,0 +1,66 @@ +name: Test (Linux, CUDA) + +on: + pull_request: + branches: [main] + types: [labeled, synchronize, opened] + schedule: + - cron: "0 10 * * *" # runs at 10:00 UTC (03:00 PST) every day + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + # if PR has label "cuda tests" or "all tests" or if scheduled or manually triggered + if: >- + ( + contains(github.event.pull_request.labels.*.name, 'cuda tests') || + contains(github.event.pull_request.labels.*.name, 'all tests') || + contains(github.event_name, 'schedule') || + contains(github.event_name, 'workflow_dispatch') + ) + runs-on: [self-hosted, Linux, X64, CUDA] + defaults: + run: + shell: bash -e {0} # -e to fail on error + + strategy: + fail-fast: false + matrix: + python: ["3.11"] + cuda: ["11"] + + container: + image: scverse/scvi-tools:py${{ matrix.python }}-cu${{ matrix.cuda }}-base + options: --user root --gpus all + + name: Integration (CUDA) + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + pip install ".[dev,test]" + + - name: Test + env: + MPLBACKEND: agg + PLATFORM: ${{ matrix.os }} + DISPLAY: :42 + run: | + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report + - name: Upload coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_linux_pre.yaml b/.github/workflows/test_linux_pre.yaml new file mode 100644 index 0000000..65faf10 --- /dev/null +++ b/.github/workflows/test_linux_pre.yaml @@ -0,0 +1,72 @@ +name: Test (Linux, prereleases) + +on: + pull_request: + branches: [main] + types: [labeled, synchronize, opened] + schedule: + - cron: "0 10 * * *" # runs at 10:00 UTC (03:00 PST) every day + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + # if PR has label "cuda tests" or "all tests" or if scheduled or manually triggered + if: >- + ( + contains(github.event.pull_request.labels.*.name, 'prerelease tests') || + contains(github.event.pull_request.labels.*.name, 'all tests') || + contains(github.event_name, 'schedule') || + contains(github.event_name, 'workflow_dispatch') + ) + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -e {0} # -e to fail on error + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python: ["3.9", "3.10", "3.11", "3.12"] + + name: Integration (Prereleases) + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip wheel + + - name: Install dependencies + run: | + pip install --pre ".[dev,test]" + + - name: Test + env: + MPLBACKEND: agg + PLATFORM: ${{ matrix.os }} + DISPLAY: :42 + run: | + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report + - name: Upload coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_macos.yaml b/.github/workflows/test_macos.yaml new file mode 100644 index 0000000..df05ceb --- /dev/null +++ b/.github/workflows/test_macos.yaml @@ -0,0 +1,61 @@ +name: Test (MacOS) + +on: + schedule: + - cron: "0 10 * * *" # runs at 10:00 UTC -> 03:00 PST every day + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -e {0} # -e to fail on error + + strategy: + fail-fast: false + matrix: + os: [macos-latest] + python: ["3.9", "3.10", "3.11"] + + name: Integration + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip wheel + + - name: Install dependencies + run: | + pip install ".[dev,test]" + + - name: Test + env: + MPLBACKEND: agg + PLATFORM: ${{ matrix.os }} + DISPLAY: :42 + run: | + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report + - name: Upload coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_macos_m1.yaml b/.github/workflows/test_macos_m1.yaml new file mode 100644 index 0000000..a15850c --- /dev/null +++ b/.github/workflows/test_macos_m1.yaml @@ -0,0 +1,61 @@ +name: Test (MacOS M1) + +on: + schedule: + - cron: "0 10 * * *" # runs at 10:00 UTC -> 03:00 PST every day + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -e {0} # -e to fail on error + + strategy: + fail-fast: false + matrix: + os: [macos-14] + python: ["3.9", "3.10", "3.11"] + + name: Integration + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip wheel + + - name: Install dependencies + run: | + pip install ".[dev,test]" + + - name: Test + env: + MPLBACKEND: agg + PLATFORM: ${{ matrix.os }} + DISPLAY: :42 + run: | + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report + - name: Upload coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_windows.yaml b/.github/workflows/test_windows.yaml new file mode 100644 index 0000000..927de5d --- /dev/null +++ b/.github/workflows/test_windows.yaml @@ -0,0 +1,61 @@ +name: Test (Windows) + +on: + schedule: + - cron: "0 10 * * *" # runs at 10:00 UTC (03:00 PST) every day + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -e {0} # -e to fail on error + + strategy: + fail-fast: false + matrix: + os: [windows-latest] + python: ["3.9", "3.10", "3.11"] + + name: Integration + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip wheel + + - name: Install dependencies + run: | + pip install ".[dev,test]" + + - name: Test + env: + MPLBACKEND: agg + PLATFORM: ${{ matrix.os }} + DISPLAY: :42 + run: | + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report + - name: Upload coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }}