diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4dea8c4d..4786f78b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,24 +1,22 @@ name: Coverage - on: push: branches: main pull_request: branches: "*" - jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10"] - + env: + OS: ubuntu-latest + PYTHON: '3.9' steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v2 + id: setup-python with: - python-version: ${{ matrix.python-version }} + python-version: "3.9" - uses: snok/install-poetry@v1 with: virtualenvs-create: true @@ -28,30 +26,19 @@ jobs: id: cached-poetry-dependencies uses: actions/cache@v3 with: - path: .venv - key: venv-test-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install Dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: | - make install-test - - name: Get Bitwarden Secrets - uses: bitwarden/sm-action@v1 - with: - access_token: ${{ secrets.BW_ACCESS_TOKEN }} - secrets: | - 6b0baeba-4bd1-4c7d-b0c4-b0850005549d > BW_SECRET_1 - - name: Configure 1Password Service Account - uses: 1password/load-secrets-action/configure@v1 - with: - service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - name: Load secret - uses: 1password/load-secrets-action@v1 - env: - OP_SECRET: op://app-cicd/"Better-Than-Bitwarden?"/Password + make install-test - name: Run Coverage run: | - make test + pip install coverage + pip install pytest + poetry add coverage codecov + make coverage - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} + verbose: true \ No newline at end of file diff --git a/tests/test_cov.py b/tests/test_cov.py new file mode 100644 index 00000000..59f31677 --- /dev/null +++ b/tests/test_cov.py @@ -0,0 +1,12 @@ +# import os +# from pathlib import Path +# from modelscan.modelscan import Modelscan + + +def test_coverage() -> None: + # try: + # ms = Modelscan() + # ms.scan_path(Path("")) + # except Exception: + # pass + pass