Skip to content

👷‍♂️CI/CD includes build publishing #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[paths]
source =
src
*/site-packages

[run]
branch = true
parallel = true
source =
guidellm
tests/unit

[report]
show_missing = true
precision = 2
68 changes: 51 additions & 17 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,77 @@
name: Development
---
name: Development Branch Workflow

on:
pull_request:
branches:
- '**'
branches: ["**"]

jobs:
unit-tests:
quality-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
python: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Setup 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 -- -m "smoke or sanity"
- name: Run checks (quality, types, and pre-commit)
run: |
tox -e quality
tox -e types
pre-commit run --all-files

unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install tox
- name: Run tests (smoke and sanity)
run: |
python -m tox -e test-unit -- -m "smoke or sanity"

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
python: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Setup 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
run: |
python -m pip install tox
- name: Run tests (smoke)
run: |
python -m tox -e test-integration -- -m smoke

publish:
runs-on: ubuntu-latest
uses: neuralmagic/nm-actions/actions/python-tox-release@main
with:
publish_pypi: false
publish_nm_pypi: true
build_type: dev
secrets:
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
GCP_NM_PYPI_SA: ${{ secrets.GCP_NM_PYPI_SA }}
NM_PYPI_SA: ${{ secrets.NM_PYPI_SA }}
PYPI_PUBLIC_USER: ${{ secrets.PYPI_PUBLIC_USER }}
PYPI_PUBLIC_AUTH: ${{ secrets.PYPI_PUBLIC_AUTH }}
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: Main Branch Workflow

on:
push:
branches: [main]

jobs:
quality-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ "3.9", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run checks (quality, types, and pre-commit)
run: |
tox -e quality
tox -e types
pre-commit run --all-files

unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install tox
- name: Run tests with coverage@85% (smoke, sanity, and regression)
run: |
python -m tox -e cov-unit

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install tox
- name: Run tests (smoke)
run: |
python -m tox -e test-integration -- -m smoke

publish:
runs-on: ubuntu-latest
uses: neuralmagic/nm-actions/actions/python-tox-release@main
with:
publish_pypi: false
publish_nm_pypi: true
build_type: nightly
secrets:
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
GCP_NM_PYPI_SA: ${{ secrets.GCP_NM_PYPI_SA }}
NM_PYPI_SA: ${{ secrets.NM_PYPI_SA }}
PYPI_PUBLIC_USER: ${{ secrets.PYPI_PUBLIC_USER }}
PYPI_PUBLIC_AUTH: ${{ secrets.PYPI_PUBLIC_AUTH }}
83 changes: 57 additions & 26 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,50 @@
---
name: Nightly

on:
schedule:
- cron: '0 0 * * *' # Runs at midnight every night
- cron: 0 0 * * *

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Setup 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 -- --cov-report=term-missing --cov --cov-fail-under=75
run: |
python -m pip install tox
- name: Run tests (smoke, sanity, and regression)
run: |
python -m tox -e test-unit

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration tests
- name: Run tests (smoke and sanity)
run: tox -e test-integration -- -m "smoke or sanity"

e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -65,5 +53,48 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run e2e tests
- name: Run tests (smoke)
run: tox -e test-e2e -- -m smoke

check-publish:
runs-on: ubuntu-latest
needs: [ unit-tests, integration-tests, e2e-tests ]
steps:
- uses: actions/checkout@v4
- name: Check changes (last nightly tag)
id: check_changes
run: |
git fetch origin
LAST_NIGHTLY_TAG=$(git describe --tags --match "nightly-*" --abbrev=0)
git diff --exit-code $LAST_NIGHTLY_TAG -- . || echo "changes"
- name: Set env
id: set_output
run: |
echo "::set-output name=changes_detected::$(git diff --exit-code $LAST_NIGHTLY_TAG -- . || echo 'true')"

publish:
runs-on: ubuntu-latest
needs: [ check-publish ]
uses: neuralmagic/nm-actions/actions/python-tox-release@main
with:
publish_pypi: true
publish_nm_pypi: false
build_type: nightly
secrets:
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
GCP_NM_PYPI_SA: ${{ secrets.GCP_NM_PYPI_SA }}
NM_PYPI_SA: ${{ secrets.NM_PYPI_SA }}
PYPI_PUBLIC_USER: ${{ secrets.PYPI_PUBLIC_USER }}
PYPI_PUBLIC_AUTH: ${{ secrets.PYPI_PUBLIC_AUTH }}

tag:
runs-on: ubuntu-latest
needs: [ publish ]
if: ${{ needs.check-publish.outputs.changes_detected == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Tag nightly
run: |
git tag nightly-$(date +'%Y%m%d')
git push origin --tags
40 changes: 0 additions & 40 deletions .github/workflows/publish.yml

This file was deleted.

Loading