diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 079bf66c..3ce0b608 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -12,6 +12,8 @@ on: - >- ** pull_request: + schedule: + - cron: 1 0 * * * # Run daily at 0:01 UTC jobs: build_python: @@ -127,3 +129,70 @@ jobs: grunt test env: CI: true + publish: + name: Publish to PyPI registry + needs: + - build_python + - build_javascript + runs-on: ubuntu-latest + + env: + PY_COLORS: 1 + TOXENV: packaging + + steps: + - name: Switch to using Python 3.6 by default + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install tox + run: python -m pip install --user tox + - name: Check out src from Git + uses: actions/checkout@v2 + with: + # Get shallow Git history (default) for tag creation events + # but have a complete clone for any other workflows. + # Both options fetch tags but since we're going to remove + # one from HEAD in non-create-tag workflows, we need full + # history for them. + fetch-depth: >- + ${{ + ( + github.event_name == 'create' && + github.event.ref_type == 'tag' + ) && + 1 || 0 + }} + - name: Drop Git tags from HEAD for non-tag-create events + if: >- + github.event_name != 'create' || + github.event.ref_type != 'tag' + run: >- + git tag --points-at HEAD + | + xargs git tag --delete + - name: Build dists + run: python -m tox + - name: Publish to test.pypi.org + if: >- + ( + github.event_name == 'push' && + github.ref == format( + 'refs/heads/{0}', github.event.repository.default_branch + ) + ) || + ( + github.event_name == 'create' && + github.event.ref_type == 'tag' + ) + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.testpypi_password }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish to pypi.org + if: >- # "create" workflows run separately from "push" & "pull_request" + github.event_name == 'create' && + github.event.ref_type == 'tag' + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cab9df06..00000000 --- a/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -language: python -jobs: - allow_failures: - - name: devel - python: 3.8 - dist: xenial - env: TOXENV=devel - - include: - - stage: tests - language: node_js - node_js: node - install: npm install phantomjs-prebuilt@2.1.15 grunt-cli grunt grunt-contrib-qunit - script: grunt test - - - - name: Linting - python: 3.7 - dist: xenial - sudo: required - env: TOXENV=linting - cache: - directories: - - $HOME/.cache/pre-commit - - - - python: 3.6 - env: TOXENV=py36 - - - - python: 3.7 - dist: xenial - sudo: required - env: TOXENV=py37 - - - - python: 3.8 - env: TOXENV=py38 - - - name: devel - python: 3.8 - dist: xenial - env: TOXENV=devel - - - - python: pypy3 - env: TOXENV=pypy3 - - - stage: deploy - python: 3.7 - dist: xenial - sudo: required - install: skip - script: skip - deploy: - provider: pypi - user: davehunt - password: - secure: QTNaSfTEZnCEINpCfzdOiOPZ1s6co9Fz2cEt5zv/dSZAJCiKNZvvbMzsOsRMQl1MJvp+cSHiuOir46vEGxzh2+FIl+RRSlENqF2G7jGJpfJfukBxYAhSvt9ZLT4UyBbgYz5sv9A4zs+Yo72xAS9eP+zf5bDVaQh0EzudUbb0Mv4= - distributions: sdist bdist_wheel - on: - tags: true - repo: pytest-dev/pytest-html - -cache: pip - -install: pip install tox - -script: tox diff --git a/README.rst b/README.rst index 539263af..37d7418c 100644 --- a/README.rst +++ b/README.rst @@ -13,9 +13,9 @@ HTML report for the test results. .. image:: https://img.shields.io/conda/vn/conda-forge/pytest-html.svg :target: https://anaconda.org/conda-forge/pytest-html :alt: Conda Forge -.. image:: https://img.shields.io/travis/pytest-dev/pytest-html.svg - :target: https://travis-ci.org/pytest-dev/pytest-html/ - :alt: Travis +.. image:: https://github.com/pytest-dev/pytest-html/workflows/gh/badge.svg + :target: https://github.com/pytest-dev/pytest-html/actions + :alt: CI .. image:: https://img.shields.io/github/issues-raw/pytest-dev/pytest-html.svg :target: https://github.com/pytest-dev/pytest-html/issues :alt: Issues diff --git a/development.rst b/development.rst index 302dac39..74f7f6fe 100644 --- a/development.rst +++ b/development.rst @@ -23,15 +23,12 @@ If you're not using `Pipenv`_, to install `pre-commit`, run: Automated Testing ----------------- -All pull requests and merges are tested in `Travis CI `_ -based on the ``.travis.yml`` file. +All pull requests and merges are tested in `GitHub Actions `_ +which are defined inside ``.github`` folder. -Usually, a link to your specific travis build appears in pull requests, but if -not, you can find it on the -`pull requests page `_ - -The only way to trigger Travis CI to run again for a pull request, is to submit -another change to the pull branch. +To retrigger CI to run again for a pull request, you either use dropdown +option, close and reopen pull-request or to just update the branch containing +it. You can do this with `git commit --allow-empty` @@ -67,6 +64,6 @@ Follow these steps to release a new version of the project: 5. Once merged, update your local master again (``git pull --rebase upstream master``) 6. Tag the release with the new release version (``git tag v``) 7. Push the tag (``git push upstream --tags``) -8. Done. You can monitor the progress on `Travis `_ +8. Done. Check `CI `_ for release progress. .. _Pipenv: https://pipenv.pypa.io/en/latest/ diff --git a/tox.ini b/tox.ini index a48cba33..eb087f8c 100644 --- a/tox.ini +++ b/tox.ini @@ -34,6 +34,35 @@ deps = # https://github.com/pytest-dev/pytest-rerunfailures/issues/134 # pytest @ git+https://github.com/pytest-dev/pytest.git +[testenv:packaging] +description = + Do packaging/distribution. If tag is not present or PEP440 compliant upload to + PYPI could fail +# `usedevelop = true` overrides `skip_install` instruction, it's unwanted +usedevelop = false +# don't install package in this env +skip_install = true +deps = + collective.checkdocs >= 0.2 + pep517 >= 0.8.2 + pip >= 20.2.2 + toml >= 0.10.1 + twine >= 3.2.0 +setenv = +commands = + rm -rfv {toxinidir}/dist/ + python -m pep517.build \ + --source \ + --binary \ + --out-dir {toxinidir}/dist/ \ + {toxinidir} + # metadata validation + python setup.py check + sh -c "python -m twine check {toxinidir}/dist/*" +whitelist_externals = + rm + sh + [flake8] max-line-length = 88 exclude = .eggs,.tox