diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..994ee47 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,42 @@ +name: test +run-name: Run tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + pre-commit: + name: Check pre-commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 + + pytest: + name: Run pytests + runs-on: ${{ matrix.os }} + needs: [ pre-commit ] + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + include: + - os: ubuntu-20.04 + python-version: "3.6" + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install pytest + run: pip install pytest invocations mock pytest-relaxed + - name: Setup patchwork + run: pip install -e . + - name: Test with pytest + run: pytest diff --git a/.gitignore b/.gitignore index b7e1ca4..a51ee18 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ docs/_build .cache .coverage +/venv +/build +/.idea +*.egg-info diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..68d1d2a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.21.0 + hooks: + - id: check-github-workflows diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 324732d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -sudo: false -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "pypy" - - "pypy3" -matrix: - # pypy3 (as of 2.4.0) has a wacky arity issue in its source loader. Allow it - # to fail until we can test on, and require, PyPy3.3+. See invoke#358. - allow_failures: - - python: pypy3 - # Disabled per https://github.com/travis-ci/travis-ci/issues/1696 - # fast_finish: true -install: - - pip install -r dev-requirements.txt -script: - # Run tests w/ coverage first, so it uses the local-installed copy. - # (If we do this after the below installation tests, coverage will think - # nothing got covered!) - - inv coverage --report=xml - # TODO: tighten up these install test tasks so they can be one-shotted - - inv travis.test-installation --package=patchwork --sanity="inv sanity" - - inv travis.test-packaging --package=patchwork --sanity="inv sanity" - - inv docs --nitpick - - flake8 -# TODO: after_success -> codecov, once coverage sucks less XD