Skip to content

Commit 84c504f

Browse files
markurtzsjmonson
andauthored
Update CICD flows to enable automated releases and match the feature set laid out in #56 (#125)
Fixes #56 and should enable 0.2.0 release plus automated releases going forward --------- Co-authored-by: Samuel Monson <smonson@redhat.com>
1 parent 81f156d commit 84c504f

File tree

9 files changed

+412
-133
lines changed

9 files changed

+412
-133
lines changed

.github/workflows/development.yml

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,62 @@ name: Development
22

33
on:
44
pull_request:
5-
branches:
6-
- '**'
5+
types: [opened, synchronize, reopened]
76

87
jobs:
8+
quality-checks:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python: ["3.9", "3.13"]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python }}
19+
- name: Install dependencies
20+
run: pip install tox
21+
- name: Run quality checks
22+
run: tox -e quality
23+
24+
type-checks:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
python: ["3.9", "3.13"]
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python }}
35+
- name: Install dependencies
36+
run: pip install tox
37+
- name: Run quality checks
38+
run: tox -e types
39+
40+
precommit-checks:
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
python: ["3.9", "3.13"]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: ${{ matrix.python }}
51+
- name: Install dependencies
52+
run: pip install pre-commit
53+
- name: Run pre-commit checks
54+
run: pre-commit run --all-files
55+
956
unit-tests:
1057
runs-on: ubuntu-latest
1158
strategy:
1259
matrix:
13-
python:
14-
- "3.13"
15-
- "3.9"
60+
python: ["3.9", "3.13"]
1661
steps:
1762
- uses: actions/checkout@v4
1863
- name: Set up Python
@@ -28,9 +73,7 @@ jobs:
2873
runs-on: ubuntu-latest
2974
strategy:
3075
matrix:
31-
python:
32-
- "3.13"
33-
- "3.9"
76+
python: ["3.9", "3.13"]
3477
steps:
3578
- uses: actions/checkout@v4
3679
- name: Set up Python
@@ -41,3 +84,38 @@ jobs:
4184
run: pip install tox
4285
- name: Run integration tests
4386
run: tox -e test-integration -- -m smoke
87+
88+
build:
89+
runs-on: ubuntu-latest
90+
strategy:
91+
matrix:
92+
python: ["3.9"]
93+
steps:
94+
- uses: actions/checkout@v4
95+
- name: Set up Python
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: ${{ matrix.python }}
99+
- name: Install dependencies
100+
run: pip install toml loguru tox
101+
- name: Set environment variables
102+
run: |
103+
echo "GUIDELLM_BUILD_TYPE=dev" >> $GITHUB_ENV
104+
echo "GUIDELLM_BUILD_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
105+
- name: Build the package
106+
run: tox -e build
107+
- name: Upload build artifacts
108+
id: artifact-upload
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: build-artifacts
112+
path: dist/*
113+
compression-level: 6
114+
if-no-files-found: error
115+
retention-days: 30
116+
- name: Comment Install instructions
117+
uses: mshick/add-pr-comment@v2
118+
with:
119+
message: |
120+
Build artifacts (.whl and .tar.gz) are available for download for up to 30 days.
121+
They are located at ${{ steps.artifact-upload.outputs.artifact-url }}

.github/workflows/main.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
quality-checks:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python }}
20+
- name: Install dependencies
21+
run: pip install tox
22+
- name: Run quality checks
23+
run: tox -e quality
24+
25+
type-checks:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.python }}
36+
- name: Install dependencies
37+
run: pip install tox
38+
- name: Run quality checks
39+
run: tox -e types
40+
41+
precommit-checks:
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: ${{ matrix.python }}
52+
- name: Install dependencies
53+
run: pip install pre-commit
54+
- name: Run pre-commit checks
55+
run: pre-commit run --all-files
56+
57+
unit-tests:
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
python: ["3.9", "3.13"]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Set up Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: ${{ matrix.python }}
68+
- name: Install dependencies
69+
run: pip install tox
70+
- name: Run unit tests
71+
run: tox -e test-unit -- -m "smoke or sanity"
72+
73+
integration-tests:
74+
runs-on: ubuntu-latest
75+
strategy:
76+
matrix:
77+
python: ["3.9", "3.13"]
78+
steps:
79+
- uses: actions/checkout@v4
80+
- name: Set up Python
81+
uses: actions/setup-python@v5
82+
with:
83+
python-version: ${{ matrix.python }}
84+
- name: Install dependencies
85+
run: pip install tox
86+
- name: Run integration tests
87+
run: tox -e test-integration -- -m smoke

.github/workflows/nightly.yml

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python:
13-
- "3.13"
14-
- "3.12"
15-
- "3.11"
16-
- "3.10"
17-
- "3.9"
12+
python: ["3.9", "3.13"]
1813
steps:
1914
- uses: actions/checkout@v4
2015
- name: Set up Python
@@ -24,18 +19,13 @@ jobs:
2419
- name: Install dependencies
2520
run: pip install tox
2621
- name: Run unit tests
27-
run: tox -e test-unit -- --cov-report=term-missing --cov --cov-fail-under=75
22+
run: tox -e test-unit -- -m --cov=guidellm --cov-report=term-missing --cov-fail-under=75
2823

2924
integration-tests:
3025
runs-on: ubuntu-latest
3126
strategy:
3227
matrix:
33-
python:
34-
- "3.13"
35-
- "3.12"
36-
- "3.11"
37-
- "3.10"
38-
- "3.9"
28+
python: ["3.9", "3.13"]
3929
steps:
4030
- uses: actions/checkout@v4
4131
- name: Set up Python
@@ -51,12 +41,7 @@ jobs:
5141
runs-on: ubuntu-latest
5242
strategy:
5343
matrix:
54-
python:
55-
- "3.13"
56-
- "3.12"
57-
- "3.11"
58-
- "3.10"
59-
- "3.9"
44+
python: ["3.9", "3.13"]
6045
steps:
6146
- uses: actions/checkout@v4
6247
- name: Set up Python
@@ -65,5 +50,58 @@ jobs:
6550
python-version: ${{ matrix.python }}
6651
- name: Install dependencies
6752
run: pip install tox
68-
- name: Run e2e tests
53+
- name: Run integration tests
6954
run: tox -e test-e2e -- -m smoke
55+
56+
build-and-publish:
57+
needs: [unit-tests, integration-tests, e2e-tests]
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
python: ["3.9"]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Set up Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: ${{ matrix.python }}
68+
- name: Install dependencies
69+
run: pip install toml loguru tox
70+
- name: Set environment variables
71+
run: |
72+
echo "GUIDELLM_BUILD_TYPE=nightly" >> $GITHUB_ENV
73+
echo "GUIDELLM_BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
74+
- name: Build the package
75+
run: tox -e build
76+
- name: Find wheel artifact
77+
id: find-asset-whl
78+
run: |
79+
echo "::set-output name=asset::$(find dist -name '*.whl')"
80+
- name: Find tar.gz artifact
81+
id: find-asset-targz
82+
run: |
83+
echo "::set-output name=asset::$(find dist -name '*.tar.gz')"
84+
- name: Push wheel to PyPI
85+
uses: neuralmagic/nm-actions/actions/publish-whl@v1.0.0
86+
with:
87+
username: ${{ secrets.PYPI_PUBLIC_USER }}
88+
password: ${{ secrets.PYPI_PUBLIC_AUTH }}
89+
whl: ${{ steps.find-asset-whl.outputs.asset }}
90+
- name: Push tar.gz to PyPI
91+
uses: neuralmagic/nm-actions/actions/publish-whl@v1.0.0
92+
with:
93+
username: ${{ secrets.PYPI_PUBLIC_USER }}
94+
password: ${{ secrets.PYPI_PUBLIC_AUTH }}
95+
whl: ${{ steps.find-asset-targz.outputs.asset }}
96+
- name: Upload build artifacts
97+
id: artifact-upload
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: nightly-build-artifacts
101+
path: dist/*
102+
compression-level: 6
103+
if-no-files-found: error
104+
retention-days: 30
105+
- name: Log artifact location
106+
run: |
107+
echo "Artifacts uploaded to: https://api.github.com/repos/neuralmagic/guidellm/actions/artifacts/${{ steps.artifact-upload.outputs.artifact-id }}"

.github/workflows/quality.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)