Skip to content

Commit

Permalink
Update workflows on branch
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkim0 committed Jan 18, 2024
1 parent 0663e16 commit 3e5b364
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 75 deletions.
6 changes: 0 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
name: Check Build
name: Check build

on:
push:
branches: [main]
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test-linux-cpu
name: Test (Linux)

on:
push:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -46,17 +44,19 @@ 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:
MPLBACKEND: agg
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
38 changes: 29 additions & 9 deletions .github/workflows/test_linux_cuda.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: |
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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]"
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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]"
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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]"
Expand All @@ -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

0 comments on commit 3e5b364

Please sign in to comment.