From ac70c0760ed4ac7208306cbc8a0df5432ab036e9 Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Wed, 14 Aug 2024 15:41:22 +0300 Subject: [PATCH 1/9] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=E2=99=82=EF=B8=8F=20B?= =?UTF-8?q?uilds=20are=20updated=20according=20to=20a=20new=20infrastructu?= =?UTF-8?q?re=20injector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💄 inject_build_props.py imports are sorted --- .github/workflows/development.yml | 27 ++++++++++++++++--- .github/workflows/nightly.yml | 35 +++++++++++++++++++++++- .github/workflows/publish.yml | 40 ---------------------------- .github/workflows/quality.yml | 2 +- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index f8604d0..e2715e7 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -3,7 +3,7 @@ name: Development on: pull_request: branches: - - '**' + - "**" jobs: unit-tests: @@ -28,9 +28,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.8" + python: ["3.12", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -41,3 +39,24 @@ jobs: run: pip install tox - name: Run integration tests run: tox -e test-integration -- -m smoke + + publish-dev: + needs: [unit-tests, integration-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install pypa/build and pypa/twine + run: python3 -m pip install build twine --user + - name: Build a binary wheel & Inject build props + run: python3 -m tox -e build + - name: Publish to Internal PyPI + env: + GUIDELLM_BUILD_TYPE: dev + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} + TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }} + run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/* diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bf7f34c..1ce89b3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,7 +2,7 @@ name: Nightly on: schedule: - - cron: '0 0 * * *' # Runs at midnight every night + - cron: "0 0 * * *" jobs: unit-tests: @@ -67,3 +67,36 @@ jobs: run: pip install tox - name: Run e2e tests run: tox -e test-e2e -- -m smoke + + publish-nightly: + needs: [unit-tests, integration-tests, e2e-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install pypa/build and pypa/twine + run: python3 -m pip install build twine --user + - name: Build a binary wheel & Inject build props + run: python3 -m tox -e build + - name: Publish to Internal PyPI + env: + GUIDELLM_BUILD_TYPE: nightly + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} + TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }} + run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/* + + - name: Publish to Public PyPI + if: success() + env: + env: + GUIDELLM_BUILD_TYPE: nightly + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + DATE=$(date +%Y%m%d) + python -m twine upload dist/* diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 4ea5d8a..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish Python distribution to PyPI - -on: - push: - tags: - - v* - -jobs: - build: - name: Build distribution - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.8" - - - name: Install pypa/build nad pypa/twine - run: >- - python3 -m pip install build twine --user - - - name: Build a binary wheel - run: python3 -m build - - publish-to-pypi: - name: Publish Python distribution to PyPI - needs: - - build - if: startsWith(github.ref, 'refs/tags/v') - runs-on: ubuntu-latest - steps: - - name: 🚀📦 Publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - - run: python -m twine upload dist/* diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 95d44af..62999a3 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -6,7 +6,7 @@ on: - main pull_request: branches: - - '**' + - "**" jobs: quality-check: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4fe249..77a6b22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,3 +68,47 @@ jobs: run: pip install tox - name: Run e2e tests run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75 + + publish-release-candidate: + name: Publish Release Candidate + needs: [unit-tests, integration-tests, e2e-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install pypa/build and pypa/twine + run: python3 -m pip install build twine --user + - name: Build a binary wheel & Inject build props + run: python3 -m tox -e build + - name: Publish to Internal PyPI + env: + GUIDELLM_BUILD_TYPE: dev + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} + TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }} + run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/* + + publish-final-release: + name: Publish Final Release + if: github.ref == 'refs/tags/v*' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install pypa/build and pypa/twine + run: python3 -m pip install build twine --user + - name: Build a binary wheel & Inject build props + run: python3 -m tox build + - name: Publish to Public PyPI + env: + GUIDELLM_BUILD_TYPE: release + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: python -m twine upload dist/* From 48c2389ab957214d500ab0bf38aae8349d6162c7 Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Fri, 26 Jul 2024 14:03:36 +0300 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=92=9A=20`tox`=20is=20added=20to=20th?= =?UTF-8?q?e=20installation=20process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yml | 4 ++-- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index e2715e7..c5b178a 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -38,7 +38,7 @@ jobs: - name: Install dependencies run: pip install tox - name: Run integration tests - run: tox -e test-integration -- -m smoke + run: python -m tox -e test-integration -- -m smoke publish-dev: needs: [unit-tests, integration-tests] @@ -50,7 +50,7 @@ jobs: with: python-version: "3.8" - name: Install pypa/build and pypa/twine - run: python3 -m pip install build twine --user + run: python3 -m pip install tox build twine --user - name: Build a binary wheel & Inject build props run: python3 -m tox -e build - name: Publish to Internal PyPI diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1ce89b3..736ce1f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -78,7 +78,7 @@ jobs: with: python-version: "3.8" - name: Install pypa/build and pypa/twine - run: python3 -m pip install build twine --user + run: python3 -m pip install tox build twine --user - name: Build a binary wheel & Inject build props run: python3 -m tox -e build - name: Publish to Internal PyPI diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77a6b22..488af81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,7 +80,7 @@ jobs: with: python-version: "3.8" - name: Install pypa/build and pypa/twine - run: python3 -m pip install build twine --user + run: python3 -m pip install tox build twine --user - name: Build a binary wheel & Inject build props run: python3 -m tox -e build - name: Publish to Internal PyPI @@ -102,7 +102,7 @@ jobs: with: python-version: "3.8" - name: Install pypa/build and pypa/twine - run: python3 -m pip install build twine --user + run: python3 -m pip install tox build twine --user - name: Build a binary wheel & Inject build props run: python3 -m tox build - name: Publish to Public PyPI From c81e6485b755eaa5c3bdd2625208f69d9f16fe2c Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Thu, 15 Aug 2024 00:37:25 +0300 Subject: [PATCH 3/9] =?UTF-8?q?=F0=9F=91=B7=20neuralmagic/nm-actions/actio?= =?UTF-8?q?ns/publisher=20is=20used=20for=20distributions=20dev,=20staging?= =?UTF-8?q?,=20nightly=20and=20release=20workflows=20are=20prepared?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yml | 36 ++++++++------ .github/workflows/nightly.yml | 32 +++--------- .github/workflows/release.yml | 42 +++------------- .github/workflows/staging.yml | 83 +++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/staging.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index c5b178a..5d726d5 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -1,6 +1,10 @@ name: Development on: + push: + branches: + - "main" + pull_request: branches: - "**" @@ -20,9 +24,11 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install dependencies - run: pip install tox + run: | + python -m pip install tox - name: Run unit tests - run: tox -e test-unit -- -m "smoke or sanity" + run: | + python -m tox -e test-unit -- -m "smoke or sanity" integration-tests: runs-on: ubuntu-latest @@ -36,12 +42,14 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install dependencies - run: pip install tox + run: python -m pip install tox - name: Run integration tests run: python -m tox -e test-integration -- -m smoke - publish-dev: - needs: [unit-tests, integration-tests] + publish: + if: github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' + name: Build & Publish the distribution + needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -49,14 +57,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: Install pypa/build and pypa/twine - run: python3 -m pip install tox build twine --user - - name: Build a binary wheel & Inject build props - run: python3 -m tox -e build - - name: Publish to Internal PyPI - env: - GUIDELLM_BUILD_TYPE: dev - GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} - TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }} - run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/* + - name: Build and Publish Final Release + uses: neuralmagic/nm-actions/actions/publisher@main + with: + publish_pypi: false + publish_pypi_internal: true + timestamp: true + prefix: "-dev" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 736ce1f..bd124da 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -68,7 +68,7 @@ jobs: - name: Run e2e tests run: tox -e test-e2e -- -m smoke - publish-nightly: + publish: needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest steps: @@ -77,26 +77,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: Install pypa/build and pypa/twine - run: python3 -m pip install tox build twine --user - - name: Build a binary wheel & Inject build props - run: python3 -m tox -e build - - name: Publish to Internal PyPI - env: - GUIDELLM_BUILD_TYPE: nightly - GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} - TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }} - run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/* - - - name: Publish to Public PyPI - if: success() - env: - env: - GUIDELLM_BUILD_TYPE: nightly - GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - DATE=$(date +%Y%m%d) - python -m twine upload dist/* + - name: Build and Publish a Candidate Release + uses: neuralmagic/nm-actions/actions/publisher@main + with: + publish_pypi_internal: true + publish_pypi: true + timestamp: true + prefix: "nightly-" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 488af81..af52eaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,8 @@ name: Release on: push: + tags: + - v* branches: - release/** @@ -69,8 +71,8 @@ jobs: - name: Run e2e tests run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75 - publish-release-candidate: - name: Publish Release Candidate + publish: + name: Build & Publish the distribution needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest steps: @@ -79,36 +81,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: Install pypa/build and pypa/twine - run: python3 -m pip install tox build twine --user - - name: Build a binary wheel & Inject build props - run: python3 -m tox -e build - - name: Publish to Internal PyPI - env: - GUIDELLM_BUILD_TYPE: dev - GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} - TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }} - run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/* - - publish-final-release: - name: Publish Final Release - if: github.ref == 'refs/tags/v*' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Build and Publish Final Release + uses: neuralmagic/nm-actions/actions/publisher@main with: - python-version: "3.8" - - name: Install pypa/build and pypa/twine - run: python3 -m pip install tox build twine --user - - name: Build a binary wheel & Inject build props - run: python3 -m tox build - - name: Publish to Public PyPI - env: - GUIDELLM_BUILD_TYPE: release - GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }} - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: python -m twine upload dist/* + publish_pypi_internal: true + publish_pypi: true diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 0000000..06e2b68 --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,83 @@ +name: Staging + +on: + push: + branches: + - release/** + +jobs: + unit-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + 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 -- --cov-report=term-missing --cov --cov-fail-under=75 + + integration-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + 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 -- --cov-report=term-missing --cov --cov-fail-under=75 + + e2e-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + 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 e2e tests + run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75 + + publish: + name: Build & Publish the distribution + needs: [unit-tests, integration-tests, e2e-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Build and Publish a Candidate Release + uses: neuralmagic/nm-actions/actions/publisher@main From 6ca56d304c985a75dba21ec20072cf8488ea3e8b Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Fri, 16 Aug 2024 15:46:08 +0300 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=E2=99=82=EF=B8=8F=20'?= =?UTF-8?q?build=5Ftype'=20is=20used=20for=20renaming=20the=20build=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yml | 7 +++---- .github/workflows/nightly.yml | 7 +++---- .github/workflows/release.yml | 5 +++-- .github/workflows/staging.yml | 6 +++++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 5d726d5..914df24 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -57,10 +57,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: Build and Publish Final Release - uses: neuralmagic/nm-actions/actions/publisher@main + - name: Build and Publish Candidate Release + uses: neuralmagic/nm-actions/actions/publish_pypi@main with: publish_pypi: false publish_pypi_internal: true - timestamp: true - prefix: "-dev" + build_type: "dev" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bd124da..86cbddf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -78,9 +78,8 @@ jobs: with: python-version: "3.8" - name: Build and Publish a Candidate Release - uses: neuralmagic/nm-actions/actions/publisher@main + uses: neuralmagic/nm-actions/actions/publish_pypi@main with: - publish_pypi_internal: true publish_pypi: true - timestamp: true - prefix: "nightly-" + publish_pypi_internal: true + build_type: "nightly" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af52eaf..fac9898 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,8 @@ jobs: with: python-version: "3.8" - name: Build and Publish Final Release - uses: neuralmagic/nm-actions/actions/publisher@main + uses: neuralmagic/nm-actions/actions/publish_pypi@main with: - publish_pypi_internal: true publish_pypi: true + publish_pypi_internal: true + build_type: "release" diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 06e2b68..44ec439 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -80,4 +80,8 @@ jobs: with: python-version: "3.8" - name: Build and Publish a Candidate Release - uses: neuralmagic/nm-actions/actions/publisher@main + uses: neuralmagic/nm-actions/actions/publish_pypi@main + with: + publish_pypi: false + publish_pypi_internal: true + build_type: "release" From 2c340ec7b54b4f8c8d489fe17e83588b9aa26b4c Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Wed, 21 Aug 2024 22:00:55 +0300 Subject: [PATCH 5/9] =?UTF-8?q?=F0=9F=91=B7=20utils/inject=5Fbuild=5Fprops?= =?UTF-8?q?.py=20controls=20the=20dist=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yml | 4 +++- .github/workflows/nightly.yml | 4 +++- .github/workflows/release.yml | 4 +++- .github/workflows/staging.yml | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 914df24..3f51ee9 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -51,6 +51,9 @@ jobs: name: Build & Publish the distribution needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest + env: + GUIDELLM_BUILD_TYPE: dev + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }} steps: - uses: actions/checkout@v4 - name: Set up Python @@ -62,4 +65,3 @@ jobs: with: publish_pypi: false publish_pypi_internal: true - build_type: "dev" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 86cbddf..1b53026 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -71,6 +71,9 @@ jobs: publish: needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest + env: + GUIDELLM_BUILD_TYPE: nightly + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }} steps: - uses: actions/checkout@v4 - name: Set up Python @@ -82,4 +85,3 @@ jobs: with: publish_pypi: true publish_pypi_internal: true - build_type: "nightly" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fac9898..fd0975e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,6 +75,9 @@ jobs: name: Build & Publish the distribution needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest + env: + GUIDELLM_BUILD_TYPE: release + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }} steps: - uses: actions/checkout@v4 - name: Set up Python @@ -86,4 +89,3 @@ jobs: with: publish_pypi: true publish_pypi_internal: true - build_type: "release" diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 44ec439..572e2d9 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -73,6 +73,9 @@ jobs: name: Build & Publish the distribution needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest + env: + GUIDELLM_BUILD_TYPE: release + GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }} steps: - uses: actions/checkout@v4 - name: Set up Python @@ -84,4 +87,3 @@ jobs: with: publish_pypi: false publish_pypi_internal: true - build_type: "release" From a174a8e72203bf249bd7803097c70294c4ba2f31 Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Thu, 22 Aug 2024 18:57:23 +0300 Subject: [PATCH 6/9] =?UTF-8?q?=F0=9F=94=A5=20utils/inject=5Fbuild=5Fprops?= =?UTF-8?q?=20->=20/nm-actions=20repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tox.ini | 1 - utils/__init__.py | 0 utils/inject_build_props.py | 79 ------------------------------------- 3 files changed, 80 deletions(-) delete mode 100644 utils/__init__.py delete mode 100644 utils/inject_build_props.py diff --git a/tox.ini b/tox.ini index 076f7b8..5387b53 100644 --- a/tox.ini +++ b/tox.ini @@ -69,7 +69,6 @@ deps = loguru toml commands = - python utils/inject_build_props.py python -m build diff --git a/utils/__init__.py b/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/utils/inject_build_props.py b/utils/inject_build_props.py deleted file mode 100644 index 74000dd..0000000 --- a/utils/inject_build_props.py +++ /dev/null @@ -1,79 +0,0 @@ -import os -import re -from datetime import datetime -from pathlib import Path - -import toml -from loguru import logger - - -def get_build_type(): - return os.getenv("GUIDELLM_BUILD_TYPE", "dev") - - -def get_build_number(): - return os.getenv("GUIDELLM_BUILD_NUMBER", "0") - - -def construct_project_name_and_version(build_type, build_number, current_version): - if not re.match(r"^\d+\.\d+\.\d+$", current_version): - raise ValueError( - f"Version '{current_version}' does not match the " - f"semantic versioning pattern '#.#.#'", - ) - - if build_type == "dev": - project_name = "guidellm_dev" - version = f"{current_version}.dev{build_number}" - elif build_type == "nightly": - project_name = "guidellm_nightly" - date_str = datetime.now().strftime("%Y%m%d") - version = f"{current_version}.{date_str}" - elif build_type == "release": - project_name = "guidellm" - version = current_version - else: - raise ValueError(f"Unknown build type: {build_type}") - - return project_name, version - - -def update_pyproject_toml(project_name, version): - try: - with Path("pyproject.toml").open() as file: - data = toml.load(file) - - data["project"]["name"] = project_name - data["project"]["version"] = version - - with Path("pyproject.toml").open("w") as file: - toml.dump(data, file) - - logger.info( - f"Updated project name to: {project_name} and version to: {version}", - ) - except (FileNotFoundError, toml.TomlDecodeError) as e: - logger.error(f"Error reading or writing pyproject.toml: {e}") - raise - - -def main(): - build_type = get_build_type() - build_number = get_build_number() - - with Path("pyproject.toml").open() as file: - pyproject_data = toml.load(file) - - current_version = pyproject_data["project"]["version"] - project_name, version = construct_project_name_and_version( - build_type, - build_number, - current_version, - ) - - if build_type != "release": - update_pyproject_toml(project_name, version) - - -if __name__ == "__main__": - main() From 0bb6db56cef46dbf49ccde3c52621e490a91bc57 Mon Sep 17 00:00:00 2001 From: Mark Kurtz Date: Sat, 24 Aug 2024 17:33:02 -0400 Subject: [PATCH 7/9] Stage current state --- .coveragerc | 15 ++++++ .github/workflows/development.yml | 76 ++++++++++++++++++------------- .github/workflows/main.yml | 75 ++++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 26 +++-------- .github/workflows/quality.yml | 15 ++---- .github/workflows/release.yml | 30 +++--------- .github/workflows/staging.yml | 27 +++-------- pyproject.toml | 7 +++ tox.ini | 9 ++++ 9 files changed, 174 insertions(+), 106 deletions(-) create mode 100644 .coveragerc create mode 100644 .github/workflows/main.yml diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..34b98d4 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,15 @@ +[paths] +source = + src + */site-packages + +[run] +branch = true +parallel = true +source = + guidellm + tests/unit + +[report] +show_missing = true +precision = 2 diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 914df24..53ca774 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -1,32 +1,45 @@ -name: Development +--- +name: Development Branch Workflow on: - push: - branches: - - "main" - pull_request: - branches: - - "**" + branches: ["**"] 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.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: | python -m pip install tox - - name: Run unit tests + - name: Run tests (smoke and sanity) run: | python -m tox -e test-unit -- -m "smoke or sanity" @@ -34,32 +47,31 @@ jobs: 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: python -m pip install tox - - name: Run integration tests - run: python -m 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: - if: github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' - name: Build & Publish the distribution - needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.8" - - name: Build and Publish Candidate Release - uses: neuralmagic/nm-actions/actions/publish_pypi@main - with: - publish_pypi: false - publish_pypi_internal: true - build_type: "dev" + 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 }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3baf564 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,75 @@ +--- +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 (smoke and sanity) + run: | + python -m tox -e test-unit -- -m "smoke or sanity" + + 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: 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 }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 86cbddf..3f484d5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,20 +1,16 @@ +--- name: Nightly on: schedule: - - cron: "0 0 * * *" + - 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.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -30,12 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -51,12 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -82,4 +68,4 @@ jobs: with: publish_pypi: true publish_pypi_internal: true - build_type: "nightly" + build_type: nightly diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 62999a3..936df7e 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -1,21 +1,18 @@ +--- name: Quality on: push: - branches: - - main + branches: [main] pull_request: - branches: - - "**" + branches: ["**"] jobs: quality-check: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.8" + python: ["3.12", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -31,9 +28,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.8" + python: ["3.12", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fac9898..cc227aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,23 +1,17 @@ +--- name: Release on: push: - tags: - - v* - branches: - - release/** + tags: [v*] + branches: [release/**] jobs: unit-tests: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -33,12 +27,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -54,12 +43,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -86,4 +70,4 @@ jobs: with: publish_pypi: true publish_pypi_internal: true - build_type: "release" + build_type: release diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 44ec439..7922337 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -1,21 +1,16 @@ +--- name: Staging on: push: - branches: - - release/** + branches: [release/**] jobs: unit-tests: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -31,12 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -52,12 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" + python: ["3.12", "3.11", "3.10", "3.9", "3.8"] steps: - uses: actions/checkout@v4 - name: Set up Python @@ -84,4 +69,4 @@ jobs: with: publish_pypi: false publish_pypi_internal: true - build_type: "release" + build_type: release diff --git a/pyproject.toml b/pyproject.toml index 6d07637..52cc17f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -183,3 +183,10 @@ markers = [ "sanity: detailed tests to ensure major functions work correctly", "regression: tests to ensure that new changes do not break existing functionality" ] + +[tool.yamlfix] +whitelines = 1 +section_whitelines = 1 +line_length = 88 +none_representation = "null" +quote_representation = '"' diff --git a/tox.ini b/tox.ini index 076f7b8..f4ed8d9 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,15 @@ commands = pytest tests/ {posargs} +[testenv:cov-unit] +usedevelop = true +description = Run unit tests with coverage +deps = + .[dev] +commands = + python -m pytest --cov=src --cov-report=term-missing tests/unit {posargs} + + [testenv:test-unit] description = Run unit tests deps = From 439337d5adedec375bf5cc3da77337f78bda7c20 Mon Sep 17 00:00:00 2001 From: Dmytro Parfeniuk Date: Mon, 26 Aug 2024 10:26:46 +0300 Subject: [PATCH 8/9] Failing test description is added --- tests/unit/test_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 13e1699..2dd1f57 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -9,6 +9,8 @@ ) +# FIX: This test is failing in case .env file or environment variables +# have some values defined. @pytest.mark.smoke() def test_default_settings(): settings = Settings() From ca100455a620221c67b073ab176dc376d1ce3cb7 Mon Sep 17 00:00:00 2001 From: Mark Kurtz Date: Mon, 26 Aug 2024 11:10:35 -0400 Subject: [PATCH 9/9] Commit latest state with improvements to main and dev flows and beginnings for nightly --- .github/workflows/main.yml | 12 +++--- .github/workflows/nightly.yml | 73 ++++++++++++++++++++++++----------- .github/workflows/quality.yml | 54 -------------------------- tox.ini | 4 +- 4 files changed, 60 insertions(+), 83 deletions(-) delete mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3baf564..68f150b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,9 +39,9 @@ jobs: - name: Install dependencies run: | python -m pip install tox - - name: Run tests (smoke and sanity) + - name: Run tests with coverage@85% (smoke, sanity, and regression) run: | - python -m tox -e test-unit -- -m "smoke or sanity" + python -m tox -e cov-unit integration-tests: runs-on: ubuntu-latest @@ -55,9 +55,11 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install dependencies - run: python -m pip install tox + run: | + python -m pip install tox - name: Run tests (smoke) - run: python -m tox -e test-integration -- -m smoke + run: | + python -m tox -e test-integration -- -m smoke publish: runs-on: ubuntu-latest @@ -65,7 +67,7 @@ jobs: with: publish_pypi: false publish_nm_pypi: true - build_type: dev + build_type: nightly secrets: GCP_PROJECT: ${{ secrets.GCP_PROJECT }} GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1b2d8e6..3c2b411 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,39 +10,41 @@ jobs: 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 @@ -51,23 +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: - needs: [unit-tests, integration-tests, e2e-tests] runs-on: ubuntu-latest - env: - GUIDELLM_BUILD_TYPE: nightly - GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }} + 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: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.8" - - name: Build and Publish a Candidate Release - uses: neuralmagic/nm-actions/actions/publish_pypi@main - with: - publish_pypi: true - publish_pypi_internal: true + - name: Tag nightly + run: | + git tag nightly-$(date +'%Y%m%d') + git push origin --tags diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml deleted file mode 100644 index 936df7e..0000000 --- a/.github/workflows/quality.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: Quality - -on: - push: - branches: [main] - pull_request: - branches: ["**"] - -jobs: - quality-check: - runs-on: ubuntu-latest - strategy: - matrix: - python: ["3.12", "3.8"] - 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 quality checks - run: tox -e quality - - type-check: - runs-on: ubuntu-latest - strategy: - matrix: - python: ["3.12", "3.8"] - 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 type checks - run: tox -e types - - precommit-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.8" - - name: Install pre-commit - run: pip install pre-commit - - name: Run pre-commit checks - run: pre-commit run --all-files diff --git a/tox.ini b/tox.ini index b6b5daf..6ac57f3 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,9 @@ description = Run unit tests with coverage deps = .[dev] commands = - python -m pytest --cov=src --cov-report=term-missing tests/unit {posargs} + python -m pytest --cov=src tests/unit {posargs} + coverage html + coverage report --fail-under=85 [testenv:test-unit]