Skip to content

Commit ca10045

Browse files
committed
Commit latest state with improvements to main and dev flows and beginnings for nightly
1 parent 8c25a1c commit ca10045

File tree

4 files changed

+60
-83
lines changed

4 files changed

+60
-83
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
- name: Install dependencies
4040
run: |
4141
python -m pip install tox
42-
- name: Run tests (smoke and sanity)
42+
- name: Run tests with coverage@85% (smoke, sanity, and regression)
4343
run: |
44-
python -m tox -e test-unit -- -m "smoke or sanity"
44+
python -m tox -e cov-unit
4545
4646
integration-tests:
4747
runs-on: ubuntu-latest
@@ -55,17 +55,19 @@ jobs:
5555
with:
5656
python-version: ${{ matrix.python }}
5757
- name: Install dependencies
58-
run: python -m pip install tox
58+
run: |
59+
python -m pip install tox
5960
- name: Run tests (smoke)
60-
run: python -m tox -e test-integration -- -m smoke
61+
run: |
62+
python -m tox -e test-integration -- -m smoke
6163
6264
publish:
6365
runs-on: ubuntu-latest
6466
uses: neuralmagic/nm-actions/actions/python-tox-release@main
6567
with:
6668
publish_pypi: false
6769
publish_nm_pypi: true
68-
build_type: dev
70+
build_type: nightly
6971
secrets:
7072
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
7173
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}

.github/workflows/nightly.yml

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,41 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python: ["3.12", "3.11", "3.10", "3.9", "3.8"]
13+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up Python
16+
- name: Setup Python
1717
uses: actions/setup-python@v5
1818
with:
1919
python-version: ${{ matrix.python }}
2020
- name: Install dependencies
21-
run: pip install tox
22-
- name: Run unit tests
23-
run: tox -e test-unit -- --cov-report=term-missing --cov --cov-fail-under=75
21+
run: |
22+
python -m pip install tox
23+
- name: Run tests (smoke, sanity, and regression)
24+
run: |
25+
python -m tox -e test-unit
2426
2527
integration-tests:
2628
runs-on: ubuntu-latest
2729
strategy:
2830
matrix:
29-
python: ["3.12", "3.11", "3.10", "3.9", "3.8"]
31+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
3032
steps:
3133
- uses: actions/checkout@v4
32-
- name: Set up Python
34+
- name: Setup Python
3335
uses: actions/setup-python@v5
3436
with:
3537
python-version: ${{ matrix.python }}
3638
- name: Install dependencies
3739
run: pip install tox
38-
- name: Run integration tests
40+
- name: Run tests (smoke and sanity)
3941
run: tox -e test-integration -- -m "smoke or sanity"
4042

4143
e2e-tests:
4244
runs-on: ubuntu-latest
4345
strategy:
4446
matrix:
45-
python: ["3.12", "3.11", "3.10", "3.9", "3.8"]
47+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
4648
steps:
4749
- uses: actions/checkout@v4
4850
- name: Set up Python
@@ -51,23 +53,48 @@ jobs:
5153
python-version: ${{ matrix.python }}
5254
- name: Install dependencies
5355
run: pip install tox
54-
- name: Run e2e tests
56+
- name: Run tests (smoke)
5557
run: tox -e test-e2e -- -m smoke
5658

59+
check-publish:
60+
runs-on: ubuntu-latest
61+
needs: [ unit-tests, integration-tests, e2e-tests ]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Check changes (last nightly tag)
65+
id: check_changes
66+
run: |
67+
git fetch origin
68+
LAST_NIGHTLY_TAG=$(git describe --tags --match "nightly-*" --abbrev=0)
69+
git diff --exit-code $LAST_NIGHTLY_TAG -- . || echo "changes"
70+
- name: Set env
71+
id: set_output
72+
run: |
73+
echo "::set-output name=changes_detected::$(git diff --exit-code $LAST_NIGHTLY_TAG -- . || echo 'true')"
74+
5775
publish:
58-
needs: [unit-tests, integration-tests, e2e-tests]
5976
runs-on: ubuntu-latest
60-
env:
61-
GUIDELLM_BUILD_TYPE: nightly
62-
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
77+
needs: [ check-publish ]
78+
uses: neuralmagic/nm-actions/actions/python-tox-release@main
79+
with:
80+
publish_pypi: true
81+
publish_nm_pypi: false
82+
build_type: nightly
83+
secrets:
84+
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
85+
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
86+
GCP_NM_PYPI_SA: ${{ secrets.GCP_NM_PYPI_SA }}
87+
NM_PYPI_SA: ${{ secrets.NM_PYPI_SA }}
88+
PYPI_PUBLIC_USER: ${{ secrets.PYPI_PUBLIC_USER }}
89+
PYPI_PUBLIC_AUTH: ${{ secrets.PYPI_PUBLIC_AUTH }}
90+
91+
tag:
92+
runs-on: ubuntu-latest
93+
needs: [ publish ]
94+
if: ${{ needs.check-publish.outputs.changes_detected == 'true' }}
6395
steps:
6496
- uses: actions/checkout@v4
65-
- name: Set up Python
66-
uses: actions/setup-python@v5
67-
with:
68-
python-version: "3.8"
69-
- name: Build and Publish a Candidate Release
70-
uses: neuralmagic/nm-actions/actions/publish_pypi@main
71-
with:
72-
publish_pypi: true
73-
publish_pypi_internal: true
97+
- name: Tag nightly
98+
run: |
99+
git tag nightly-$(date +'%Y%m%d')
100+
git push origin --tags

.github/workflows/quality.yml

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

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ description = Run unit tests with coverage
1717
deps =
1818
.[dev]
1919
commands =
20-
python -m pytest --cov=src --cov-report=term-missing tests/unit {posargs}
20+
python -m pytest --cov=src tests/unit {posargs}
21+
coverage html
22+
coverage report --fail-under=85
2123

2224

2325
[testenv:test-unit]

0 commit comments

Comments
 (0)