Nightly #377
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: Nightly | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs at midnight every night | |
workflow_dispatch: # Enables manual triggering of the workflow | |
jobs: | |
link-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 tox | |
- name: Run link checks | |
run: tox -e links | |
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 or sanity" | |
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 | |
e2e-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-e2e -- -m smoke | |
ui-e2e-tests: | |
permissions: | |
contents: "read" | |
id-token: "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: Generate Build | |
run: | | |
npm run build | |
- name: Start the Next.js app | |
run: | | |
npx serve@latest src/ui/out & | |
npx wait-on http://localhost:3000 # Wait until the app is ready | |
- name: Run Cypress tests | |
run: npm run test:e2e --headless | |
build-and-publish: | |
needs: [unit-tests, integration-tests, e2e-tests] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Build the package | |
run: | | |
export GUIDELLM_BUILD_TYPE=nightly | |
tox -e build | |
- name: Find wheel artifact | |
id: find-asset-whl | |
run: | | |
echo "::set-output name=asset::$(find dist -name '*.whl')" | |
- name: Find tar.gz artifact | |
id: find-asset-targz | |
run: | | |
echo "::set-output name=asset::$(find dist -name '*.tar.gz')" | |
- name: Push wheel to PyPI | |
uses: neuralmagic/nm-actions/actions/[email protected] | |
with: | |
username: ${{ secrets.PYPI_PUBLIC_USER }} | |
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | |
whl: ${{ steps.find-asset-whl.outputs.asset }} | |
- name: Push tar.gz to PyPI | |
uses: neuralmagic/nm-actions/actions/[email protected] | |
with: | |
username: ${{ secrets.PYPI_PUBLIC_USER }} | |
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | |
whl: ${{ steps.find-asset-targz.outputs.asset }} | |
- name: Upload build artifacts | |
id: artifact-upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nightly-build-artifacts | |
path: dist/* | |
compression-level: 6 | |
if-no-files-found: error | |
retention-days: 30 | |
- name: Log artifact location | |
run: | | |
echo "Artifacts uploaded to: ${{ steps.artifact-upload.outputs.artifact-url }}" | |
publish-ui-build: | |
needs: [ui-unit-tests, ui-integration-tests, ui-e2e-tests] | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: 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: "Set GIT_TAG" | |
id: vars | |
run: | | |
if [ -z "${{ github.ref_name }}" ]; then | |
echo "TAG=latest" >> $GITHUB_ENV | |
else | |
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV | |
fi | |
- name: Build app to root | |
id: build | |
run: | | |
# Export vars to ensure they are loaded before build | |
export $(grep -v '^#' .env.staging | xargs) | |
# Set asset prefix and base path with git tag | |
ASSET_PREFIX=https://blog.vllm.ai/guidellm/ui/nightly | |
BASE_PATH=/ui/nightly | |
GIT_SHA=${{ github.sha }} | |
export ASSET_PREFIX=${ASSET_PREFIX} | |
export BASE_PATH=${BASE_PATH} | |
export GIT_SHA=${GIT_SHA} | |
npm run build | |
- name: Update latest build in GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./ui/out | |
destination_dir: ui/nightly | |
keep_files: false | |
user_name: ${{ github.actor }} | |
user_email: ${{ github.actor }}@users.noreply.github.com | |
publish_branch: gh-pages | |
build-and-push-container: | |
needs: [unit-tests, integration-tests, e2e-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Buildah build | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ github.event.repository.name }} | |
tags: nightly | |
containerfiles: | | |
./deploy/Containerfile | |
- name: Push To ghcr.io | |
id: push-to-ghcr | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
registry: ghcr.io/${{ github.repository_owner }} |