Skip to content

nightly test

nightly test #27

Workflow file for this run

name: nightly test
on:
# makes workflow reusable
workflow_call:
inputs:
gitref:
description: "git commit hash or branch name"
type: string
required: true
test_label:
description: "requested runner label"
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
whl:
description: "whl to test (variable appears late binding so unusable outside 'download artifact')"
type: string
run_id:
description: run id of the BUILD job that generated the assets
type: string
code_coverage:
description: whether to collect code coverage metrics during test run
type: boolean
default: false
# makes workflow manually callable
workflow_dispatch:
inputs:
gitref:
description: "git commit hash or branch name"
type: string
required: true
test_label:
description: "requested runner label"
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
whl:
description: "whl to test (provide either whl or run_id)"
type: string
run_id:
description: run id of the BUILD job that generated the assets
type: string
code_coverage:
description: whether to collect code coverage metrics during test run
type: boolean
default: false
jobs:
TEST:
name: TEST (${{ inputs.python}}, ${{ inputs.test_label }})
runs-on: ${{ inputs.test_label }}
timeout-minutes: ${{ fromJson(inputs.timeout) }}
permissions:
contents: 'read'
id-token: 'write'
pages: 'write'
env:
HF_TOKEN: ${{ secrets.HF_RED_HAT_READ_ONLY }}
environment:
name: github-pages
url: ${{ steps.coverage.outputs.page_url }}
steps:
- name: set python
id: set_python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python }}
- name: verify python
id: verify_python
uses: neuralmagic/nm-actions/actions/verify-python@v1.2.0
with:
python-version: ${{ inputs.python }}
- name: install system dependencies
run: |-
sudo apt-get update
sudo apt-get install -y --no-install-recommends g++ gcc make
shell: bash
- name: checkout code
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitref }}
- name: create virtualenv
id: create_venv
uses: neuralmagic/nm-actions/actions/create-virtualenv@v1.2.0
with:
venv: TEST
- name: download whl
id: download
if: ${{ inputs.whl != '' }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.whl }}
path: ${{ inputs.whl }}
# GCP
- name: 'Authenticate to Google Cloud'
id: auth
uses: google-github-actions/auth@v2.1.3
with:
project_id: ${{ secrets.GCP_VLLM_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_VLLM_PROJECT_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_VLLM_PROJECT_GHA_SA }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 473.0.0'
- name: download assets
if: ${{ inputs.run_id != '' }}
uses: neuralmagic/nm-actions/actions/gcp-download-assets@v1.1.0
with:
bucket_source: ${{ secrets.GCP_VLLM_PROJECT_BUILD_ASSETS }}
run_id: ${{ inputs.run_id }}
- name: run tests
id: test
uses: ./.github/actions/test/
with:
venv: ${{ steps.create_venv.outputs.penv }}
suitename: test-${{ inputs.python }}-${{ inputs.test_label }}
code_coverage: ${{ inputs.code_coverage }}
- name: extra info for summary
if: ${{ inputs.code_coverage }}
run: |
echo "EXTRA='Code Coverage: https://neuralmagic.github.io/compressed-tensors/'" >> $GITHUB_ENV
- name: summary
uses: neuralmagic/nm-actions/actions/summary-test@v1.13.0
if: success() || failure()
with:
test_label: ${{ inputs.test_label }}
gitref: ${{ inputs.gitref }}
python: ${{ inputs.python }}
whl: ${{ inputs.whl }}
test_status: ${{ steps.test.outputs.status }}
extra: ${{ env.EXTRA }}
- name: copy results to GCP
run: |
gcloud storage cp test-results/report.xml ${{ secrets.GCP_VLLM_PROJECT_BUILD_ASSETS }}/${{ github.run_id }}/test-results/report-${{ inputs.test_label }}.xml
- name: upload results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: report-${{ inputs.python }}-${{ inputs.test_label }}.xml
path: test-results/report.xml
retention-days: 5
- name: upload coverage report
uses: actions/upload-pages-artifact@v3
if: ${{ inputs.code_coverage }}
with:
path: coverage-html
retention-days: 5
- name: deploy to Github Pages
id: coverage
uses: actions/deploy-pages@v4
if: ${{ inputs.code_coverage }}