From 3e5b3641c953314ff17245a020ec3a72ae6bf571 Mon Sep 17 00:00:00 2001 From: Martin Kim Date: Thu, 18 Jan 2024 13:19:15 -0800 Subject: [PATCH] Update workflows on branch --- .github/pull_request_template.md | 6 --- .github/workflows/build.yml | 15 ++++---- .../{test_linux_cpu.yml => test_linux.yml} | 20 +++++----- .github/workflows/test_linux_cuda.yml | 38 ++++++++++++++----- ...t_linux_cpu_pre.yml => test_linux_pre.yml} | 23 +++++------ .../{test_macos_cpu.yml => test_macos.yml} | 23 +++++------ ...{test_windows_cpu.yml => test_windows.yml} | 23 +++++------ 7 files changed, 73 insertions(+), 75 deletions(-) rename .github/workflows/{test_linux_cpu.yml => test_linux.yml} (79%) rename .github/workflows/{test_linux_cpu_pre.yml => test_linux_pre.yml} (69%) rename .github/workflows/{test_macos_cpu.yml => test_macos.yml} (70%) rename .github/workflows/{test_windows_cpu.yml => test_windows.yml} (70%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2266c7ce8e..e69de29bb2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +0,0 @@ -- [ ] Closes #xxxx (Replace xxxx with the GitHub issue number) -- [ ] Tests added and passed if fixing a bug or adding a new feature -- [ ] All code checks passed -- [ ] Added type annotations to new arguments/methods/functions -- [ ] Added an entry in the latest `docs/release_notes/index.md` file if fixing a bug or adding a new feature -- [ ] If the changes are patches for a version, I have added the `on-merge: backport to x.x.x` label diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34f816da99..3ef13868cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Check Build +name: Check build on: push: @@ -6,25 +6,24 @@ on: pull_request: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: package: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.10" cache: "pip" cache-dependency-path: "**/pyproject.toml" - - name: Install build dependencies run: python -m pip install --upgrade pip wheel twine build - - name: Build package run: python -m build - - name: Check package run: twine check --strict dist/*.whl diff --git a/.github/workflows/test_linux_cpu.yml b/.github/workflows/test_linux.yml similarity index 79% rename from .github/workflows/test_linux_cpu.yml rename to .github/workflows/test_linux.yml index 011ee449f9..6e32cebf61 100644 --- a/.github/workflows/test_linux_cpu.yml +++ b/.github/workflows/test_linux.yml @@ -1,4 +1,4 @@ -name: test-linux-cpu +name: Test (Linux) on: push: @@ -15,9 +15,6 @@ concurrency: jobs: test: runs-on: ${{ matrix.os }} - - timeout-minutes: 30 - defaults: run: shell: bash -e {0} # -e to fail on error @@ -28,13 +25,14 @@ jobs: os: [ubuntu-latest] python: ["3.9", "3.10", "3.11"] + name: ${{ matrix.name }} Python ${{ matrix.python }} + 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 with: @@ -46,9 +44,9 @@ jobs: run: | python -m pip install --upgrade pip wheel - - name: Install scvi-tools test dependencies + - name: Install dependencies run: | - pip install ".[tests]" + pip install --pre ".[tests]" - name: Test env: @@ -56,7 +54,9 @@ jobs: PLATFORM: ${{ matrix.os }} DISPLAY: :42 run: | - pytest -v --cov --color=yes - + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test_linux_cuda.yml b/.github/workflows/test_linux_cuda.yml index 7ddcded858..20d5376978 100644 --- a/.github/workflows/test_linux_cuda.yml +++ b/.github/workflows/test_linux_cuda.yml @@ -1,16 +1,26 @@ -name: test-linux-cuda +name: Test (Linux, CUDA) on: + push: + branches: + [main, 0.15.x, 0.16.x, 0.17.x, 0.18.x, 0.19.x, 0.20.x, 1.0.x, 1.1.x] + pull_request: + branches: + [main, 0.15.x, 0.16.x, 0.17.x, 0.18.x, 0.19.x, 0.20.x, 1.0.x, 1.1.x] 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: [self-hosted, Linux, X64, CUDA] - - timeout-minutes: 30 + defaults: + run: + shell: bash -e {0} # -e to fail on error strategy: fail-fast: false @@ -22,9 +32,17 @@ jobs: image: martinkim0/scvi-tools:py${{ matrix.python }}-cu${{ matrix.cuda }}-base options: --user root --gpus all + environment: + name: approved_test + + name: ${{ matrix.name }} Python ${{ matrix.python }} CUDA + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | @@ -33,10 +51,12 @@ jobs: - name: Test env: MPLBACKEND: agg - PLATFORM: ubuntu + PLATFORM: ${{ matrix.os }} DISPLAY: :42 run: | - pytest -v --cov --color=yes --accelerator cuda --devices auto - + coverage run -m pytest -v --color=yes --accelerator cuda --devices auto + - name: Report coverage + run: | + coverage report - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test_linux_cpu_pre.yml b/.github/workflows/test_linux_pre.yml similarity index 69% rename from .github/workflows/test_linux_cpu_pre.yml rename to .github/workflows/test_linux_pre.yml index 95b2822bee..36ab3d21ee 100644 --- a/.github/workflows/test_linux_cpu_pre.yml +++ b/.github/workflows/test_linux_pre.yml @@ -1,10 +1,8 @@ -name: test-linux-cpu-prerelease +name: Test (Linux, prerelease) on: schedule: - cron: "0 10 * * *" # runs at 10:00 UTC -> 03:00 PST every day - issue_comment: - types: [created] # runs if issue/PR has a specific comment workflow_dispatch: concurrency: @@ -14,12 +12,6 @@ concurrency: jobs: test: runs-on: ${{ matrix.os }} - - timeout-minutes: 30 - - # run if scheduled or pr has the comment 'test linux cpu prelease' - if: github.event_name == 'schedule' || (github.event.issue.pull_request != '' && contains(github.event.comment.body, 'test linux cpu prerelease')) - defaults: run: shell: bash -e {0} # -e to fail on error @@ -30,13 +22,14 @@ jobs: os: [ubuntu-latest] python: ["3.9", "3.10", "3.11", "3.12"] + name: ${{ matrix.name }} Python ${{ matrix.python }} prereleases + 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 with: @@ -48,7 +41,7 @@ jobs: run: | python -m pip install --upgrade pip wheel - - name: Install scvi-tools test dependencies + - name: Install dependencies run: | pip install --pre ".[tests]" @@ -58,7 +51,9 @@ jobs: PLATFORM: ${{ matrix.os }} DISPLAY: :42 run: | - pytest -v --cov --color=yes - + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test_macos_cpu.yml b/.github/workflows/test_macos.yml similarity index 70% rename from .github/workflows/test_macos_cpu.yml rename to .github/workflows/test_macos.yml index 61617ae49b..02665e40fa 100644 --- a/.github/workflows/test_macos_cpu.yml +++ b/.github/workflows/test_macos.yml @@ -1,10 +1,8 @@ -name: test-macos-cpu +name: Test (MacOS) on: schedule: - cron: "0 10 * * *" # runs at 10:00 UTC -> 03:00 PST every day - issue_comment: - types: [created] # runs if issue/PR has a specific comment workflow_dispatch: concurrency: @@ -14,12 +12,6 @@ concurrency: jobs: test: runs-on: ${{ matrix.os }} - - timeout-minutes: 30 - - # run if scheduled or pr has the comment 'test macos cpu' - if: github.event_name == 'schedule' || (github.event.issue.pull_request != '' && contains(github.event.comment.body, 'test macos cpu')) - defaults: run: shell: bash -e {0} # -e to fail on error @@ -30,13 +22,14 @@ jobs: os: [macos-latest] python: ["3.9", "3.10", "3.11"] + name: ${{ matrix.name }} Python ${{ matrix.python }} + 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 with: @@ -48,7 +41,7 @@ jobs: run: | python -m pip install --upgrade pip wheel - - name: Install scvi-tools test dependencies + - name: Install dependencies run: | pip install ".[tests]" @@ -58,7 +51,9 @@ jobs: PLATFORM: ${{ matrix.os }} DISPLAY: :42 run: | - pytest -v --cov --color=yes - + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test_windows_cpu.yml b/.github/workflows/test_windows.yml similarity index 70% rename from .github/workflows/test_windows_cpu.yml rename to .github/workflows/test_windows.yml index b8e2bf1a47..3a1164010d 100644 --- a/.github/workflows/test_windows_cpu.yml +++ b/.github/workflows/test_windows.yml @@ -1,10 +1,8 @@ -name: test-windows-cpu +name: Test (Windows) on: schedule: - cron: "0 10 * * *" # runs at 10:00 UTC -> 03:00 PST every day - issue_comment: - types: [created] # runs if issue/PR has a specific comment workflow_dispatch: concurrency: @@ -14,12 +12,6 @@ concurrency: jobs: test: runs-on: ${{ matrix.os }} - - timeout-minutes: 30 - - # run if scheduled or pr has the comment 'test windows cpu' - if: github.event_name == 'schedule' || (github.event.issue.pull_request != '' && contains(github.event.comment.body, 'test windows cpu')) - defaults: run: shell: bash -e {0} # -e to fail on error @@ -30,13 +22,14 @@ jobs: os: [windows-latest] python: ["3.9", "3.10", "3.11"] + name: ${{ matrix.name }} Python ${{ matrix.python }} + 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 with: @@ -48,7 +41,7 @@ jobs: run: | python -m pip install --upgrade pip wheel - - name: Install scvi-tools test dependencies + - name: Install dependencies run: | pip install ".[tests]" @@ -58,7 +51,9 @@ jobs: PLATFORM: ${{ matrix.os }} DISPLAY: :42 run: | - pytest -v --cov --color=yes - + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report - name: Upload coverage uses: codecov/codecov-action@v3