Skip to content

Commit

Permalink
split main and prs gha to allow dependabot-only cov step
Browse files Browse the repository at this point in the history
  • Loading branch information
NickLucche authored and dtrifiro committed Sep 17, 2024
1 parent 20db20b commit cd73ed9
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 2 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/pr_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Tests

on:
# this target allows you to run tests in base context and access secrets
# so we can have dependabot PRs auto-merge on test pass
pull_request_target:
branches:
- main
merge_group:
workflow_dispatch:

env:
FORCE_COLOR: "1"
# facilitate testing by building vLLM for CPU when needed
VLLM_CPU_DISABLE_AVX512: "true"
VLLM_TARGET_DEVICE: "cpu"
# prefer torch cpu version
PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
tests:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
pyv: ["3.11"]
vllm_version:
# - "" # skip the pypi version as it will not work on CPU
- "git+https://github.com/vllm-project/vllm@v0.6.1"
- "git+https://github.com/vllm-project/vllm@main"
- "git+https://github.com/opendatahub-io/vllm@main"

steps:
- name: Check out the PR
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Free Disk Space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false
docker-images: false
- name: Install vLLM build deps
run: |
sudo apt update
sudo apt install --no-install-recommends -y \
libnuma-dev libdnnl-dev opencl-dev
- name: Set up Python ${{ matrix.pyv }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}

- name: Upgrade pip and nox
run: |
python -m pip install --upgrade pip nox
pip --version
nox --version
- name: Lint code and check dependencies
run: nox -v -s lint-${{ matrix.pyv }}

- name: Run tests
run: nox -v -s tests-${{ matrix.pyv }} -- --cov-report=xml
env:
VLLM_VERSION_OVERRIDE: ${{ matrix.vllm_version }}

- name: Upload coverage report (Dependabot only)
if: github.actor == 'dependabot[bot]'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Build package
run: nox -s build-${{ matrix.pyv }}
2 changes: 0 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Tests
on:
push:
branches: [main]
pull_request:
merge_group:
workflow_dispatch:
schedule:
- cron: "20 4 * * 2" # once a week
Expand Down

0 comments on commit cd73ed9

Please sign in to comment.