diff --git a/.coverage b/.coverage new file mode 100644 index 00000000..c3f18471 Binary files /dev/null and b/.coverage differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 433eac75..ec87eac3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,25 @@ name: Workflow for Codecov example-python -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: + run: - runs-on: ubuntu-latest + name: Python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + # fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.7", "3.8", "3.9"] + steps: - name: Checkout uses: actions/checkout@v2 - - name: Set up Python 3.9 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} + - name: Install dependencies run: pip install -r requirements.txt - name: Run tests and collect coverage diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1d17dae1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv diff --git a/__pycache__/test_module.cpython-38-pytest-6.2.5.pyc b/__pycache__/test_module.cpython-38-pytest-6.2.5.pyc new file mode 100644 index 00000000..4ead6d61 Binary files /dev/null and b/__pycache__/test_module.cpython-38-pytest-6.2.5.pyc differ diff --git a/__pycache__/tests.cpython-38-pytest-6.2.5.pyc b/__pycache__/tests.cpython-38-pytest-6.2.5.pyc new file mode 100644 index 00000000..966ef48a Binary files /dev/null and b/__pycache__/tests.cpython-38-pytest-6.2.5.pyc differ diff --git a/awesome/__pycache__/__init__.cpython-38.pyc b/awesome/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..53c99f52 Binary files /dev/null and b/awesome/__pycache__/__init__.cpython-38.pyc differ diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..e51cc277 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,12 @@ +coverage: + status: + project: + default: + informational: true + target: auto + # adjust accordingly based on how flaky your tests are + # this allows a 10% drop from the previous base commit coverage + threshold: 10% + patch: + default: + informational: true diff --git a/coverage.xml b/coverage.xml new file mode 100644 index 00000000..f6dad182 --- /dev/null +++ b/coverage.xml @@ -0,0 +1,36 @@ + + + + + + /workspaces/example-python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/requirements.txt b/requirements.txt index 4ebc8aea..c4ac4332 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,5 @@ coverage +pytest +pytest-cov + + diff --git a/test_module.py b/test_module.py new file mode 100644 index 00000000..c7023de6 --- /dev/null +++ b/test_module.py @@ -0,0 +1,5 @@ +import awesome + + +def test_add(): + assert awesome.smile() == ":)" diff --git a/tests.py b/tests.py deleted file mode 100644 index 92aa2034..00000000 --- a/tests.py +++ /dev/null @@ -1,12 +0,0 @@ -import unittest - -import awesome - - -class TestMethods(unittest.TestCase): - def test_add(self): - self.assertEqual(awesome.smile(), ":)") - - -if __name__ == '__main__': - unittest.main()