diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..ef2ed11 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,21 @@ +name: lint + +on: + pull_request: + push: + branches: + - trunk + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + cache: pip + cache-dependency-path: | + requirements.txt + test_requirements.txt + - run: pip install -r requirements.txt -r test_requirements.txt + - uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..206b36c --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,56 @@ +name: pytest + +on: + pull_request: + push: + branches: + - trunk + +jobs: + pytest: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + name: Python ${{ matrix.python-version }} pytest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + cache: pip + cache-dependency-path: | + requirements.txt + test_requirements.txt + + - name: Install requirements + run: pip install -r requirements.txt -r test_requirements.txt + + - name: Execute pytest + run: pytest tests/ + + - name: Convert coverage + run: coverage lcov + + - name: Coveralls Parallel + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.github_token }} + flag-name: python-${{ matrix.python-version }} + path-to-lcov: coverage.lcov + parallel: true + + finish: + needs: + - pytest + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.github_token }} + path-to-lcov: coverage.lcov + parallel-finished: true diff --git a/.gitignore b/.gitignore index c835763..0daed63 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ # Profiling data *.prof +# Coverage data +lcov.info +*.lcov + # Created by https://www.gitignore.io/api/python ### Python ### diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 60077e6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: python -stages: - - lint - - test - -cache: pip - -before_install: - - pip install -U pip - - pip install -U -r test_requirements.txt - -install: python setup.py develop - -script: - - pytest tests/ - - coveralls - -jobs: - include: - - python: "3.8" - - python: "3.9" - - python: "3.10" - - - stage: lint - python: "3.8.5" - install: - - pip install -r requirements.txt - - pip install pre-commit - - pre-commit install-hooks - script: - - pre-commit run --all-files - after_script: null diff --git a/test_requirements.txt b/test_requirements.txt index 03f9438..59eb0b3 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,6 +1,6 @@ attrs>=17.4.0 black>=18.6b4 -coverage<5.0 +coverage>=5.5 doc8>=0.8.0 flake8-bugbear>=17.3.0 flake8-comprehensions>=1.2.1 @@ -13,6 +13,5 @@ Pygments>=2.3.1 pylint>=2.3.1 pytest-cov>=2.6.0 pytest>=3.0.2 -python-coveralls>=2.9.0 responses>=0.10.5 types-requests>=2.27 diff --git a/tests/mtg/test_util.py b/tests/mtg/test_util.py index 0efeb82..a99ac43 100644 --- a/tests/mtg/test_util.py +++ b/tests/mtg/test_util.py @@ -47,7 +47,7 @@ def test_is_strict_basic(name: str, expected: bool) -> None: pytest.param( "Viscera Seer", UUID("dba1cf83-e13d-401e-b76f-b12a51b307f9"), - 0, + None, "VS", ), ],