first benchark testing example (#328) #79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
quality-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run quality checks | |
run: tox -e quality | |
ui-quality-checks: | |
permissions: | |
contents: "read" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run quality and typing checks | |
run: npm run lint | |
type-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run quality checks | |
run: tox -e types | |
ui-type-checks: | |
permissions: | |
contents: "read" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run quality and typing checks | |
run: npm run type-check | |
precommit-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install pre-commit | |
- name: Run pre-commit checks | |
run: SKIP=ruff-format pre-commit run --all-files | |
ui-precommit-checks: | |
permissions: | |
contents: "read" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run pre-commit checks | |
run: npx husky run pre-commit | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run unit tests | |
run: tox -e test-unit | |
ui-unit-tests: | |
permissions: | |
contents: "read" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run unit tests | |
run: npm run test:unit | |
integration-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run integration tests | |
run: tox -e test-integration -- -m smoke | |
ui-integration-tests: | |
permissions: | |
contents: "read" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run integration tests | |
run: npm run test:integration | |
deploy-ui-build: | |
needs: [ui-quality-checks, ui-precommit-checks, ui-unit-tests, ui-type-checks, ui-integration-tests] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build app to root | |
id: build | |
run: | | |
# Export vars to ensure they are loaded before build | |
export $(grep -v '^#' .env.development | xargs) | |
# Set asset prefix and base path with PR number | |
ASSET_PREFIX=https://blog.vllm.ai/guidellm/ui/dev | |
BASE_PATH=/ui/dev | |
GIT_SHA=${{ github.sha }} | |
export ASSET_PREFIX=${ASSET_PREFIX} | |
export BASE_PATH=${BASE_PATH} | |
export GIT_SHA=${GIT_SHA} | |
npm run build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./src/ui/out | |
destination_dir: ui/dev | |
keep_files: false | |
user_name: ${{ github.actor }} | |
user_email: ${{ github.actor }}@users.noreply.github.com | |
publish_branch: gh-pages |