diff --git a/.github/workflows/cpu-tests.yml b/.github/workflows/cpu-tests.yml index e94a7435..6df676ac 100644 --- a/.github/workflows/cpu-tests.yml +++ b/.github/workflows/cpu-tests.yml @@ -15,15 +15,14 @@ defaults: shell: bash jobs: - cpu-tests: + pytester: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - include: - - {os: "macOS-13", python-version: "3.10"} - - {os: "ubuntu-22.04", python-version: "3.10"} - - {os: "windows-2022", python-version: "3.10"} + os: ["ubuntu-22.04", "macos-13", "windows-2022"] + python-version: ["3.10"] + pkg-install: ["no", "yes"] timeout-minutes: 15 steps: @@ -38,15 +37,29 @@ jobs: pyproject.toml setup.py - - name: Run tests without the package installed + - name: Install package & dependencies run: | pip install ".[all]" pytest pip list - pytest --disable-pytest-warnings --strict-markers --color=yes + - name: Drop package itself + if: matrix.pkg-install == 'no' + run: pip uninstall -y lit-llama - name: Run tests - run: | - pip install . --no-deps + run: pytest -v --durations=10 + - pytest -v --durations=10 --disable-pytest-warnings --strict-markers --color=yes + testing-guardian: + runs-on: ubuntu-latest + needs: pytester + if: always() + steps: + - run: echo "${{ needs.pytester.result }}" + - name: failing... + if: needs.pytester.result == 'failure' + run: exit 1 + - name: cancelled or skipped... + if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result) + timeout-minutes: 1 + run: sleep 90 diff --git a/pyproject.toml b/pyproject.toml index 88cdef14..72c1aa8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,3 +36,11 @@ where = ["."] # list of folders that contain the packages (["."] by default) include = ["lit_llama"] # package names should match these glob patterns (["*"] by default) exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) + + +[tool.pytest.ini_options] +addopts = [ + "--strict-markers", + "--color=yes", + "--disable-pytest-warnings", +]