Fix for container rc tag (#389) #21
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: Release Candidate | |
on: | |
push: | |
branches: | |
- 'release/*' | |
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.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 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.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 integration tests | |
run: tox -e test-integration | |
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.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 end-to-end tests | |
run: tox -e test-e2e | |
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=candidate | |
tox -e build | |
- name: Upload build artifacts | |
id: artifact-upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-candidate-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 }}" | |
- name: Push wheel to PyPI | |
uses: neuralmagic/nm-actions/actions/[email protected] | |
with: | |
username: ${{ secrets.PYPI_PUBLIC_USER }} | |
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | |
whl: $(find dist -name '*.whl') | |
- 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: $(find dist -name '*.tar.gz') | |
publish-versioned-ui-build: | |
needs: [ui-unit-tests, ui-integration-tests, ui-e2e-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: "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/release/${TAG} | |
BASE_PATH=/ui/release/${TAG} | |
GIT_SHA=${{ github.sha }} | |
export ASSET_PREFIX=${ASSET_PREFIX} | |
export BASE_PATH=${BASE_PATH} | |
export GIT_SHA=${GIT_SHA} | |
npm run build | |
- name: Deploy versioned build to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: .src/ui/out | |
destination_dir: ui/release/${TAG} | |
keep_files: false | |
user_name: ${{ github.actor }} | |
user_email: ${{ github.actor }}@users.noreply.github.com | |
publish_branch: gh-pages | |
publish-latest-ui-build: | |
needs: [publish-versioned-ui-build] | |
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/release/latest | |
BASE_PATH=/ui/release/latest | |
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: ./src/ui/out | |
destination_dir: ui/release/latest | |
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 | |
with: | |
fetch-depth: 0 | |
- name: Get version from branch | |
run: echo "PACKAGE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Buildah build | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ github.event.repository.name }} | |
build-args: | | |
GUIDELLM_BUILD_TYPE=candidate | |
tags: ${{ env.package_version }}~rc | |
containerfiles: | | |
./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 }} |