diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..1cd5fe4 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,87 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Build, Test and Release Python Package + +on: + push: + pull_request: + branches: [ master ] + +jobs: + build: + + # Currently Ubuntu 20.04 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + python -m pip install pytest + - name: Test with pytest + run: | + python -m pytest --doctest-modules --junitxml junit/test-results-${{ matrix.python-version }}.xml + - name: Publish pytest test results + uses: mikepenz/action-junit-report@v2 + with: + report_paths: junit/test-results*.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + deploy-test: + runs-on: ubuntu-latest + environment: Development + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + # Build on the latest version of Python + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build --sdist --wheel + - name: Publish package to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.DEV_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + + deploy-production: + runs-on: ubuntu-latest + environment: Production + if: startsWith(github.ref, 'refs/tags') + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + # Build on the latest version of Python + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build --sdist --wheel + - name: Publish package to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PROD_PYPI_API_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ff76aa0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" -install: - - "pip install ." - - "pip install nose" -script: nosetests --with-doctest -jobs: - include: - - stage: build - python: "3.9" - deploy: - # production pypi - - provider: pypi - distributions: sdist bdist_wheel - user: "__token__" - password: - secure: "Djo5OsdaQpx/dXxN1Mmcdx6AZJfXIB5Ji40PpSdNj8k2bNQM4YKg3/lMk3lfZnZx5ZzZfUvwi6GQ5l18B+d+O+7xmDmaO0d57pQsk1N/QXQejEM6EvRC1sN/BVla/5hQAwkoZo5EfSRY5B9O4VaX/QmBt26+dcEk5P4e8Lc27TZ9xqFPKWwQRzutwv96Goz3LP3vosdgUcGqDrc9+IIiVZV40yWG69VZ+2u9b8aCrL0Husc0ZtidPOIoGwL+zxb1i49xGwxM23DDRBDZWCbRDMecIix77rcf1GjaA4zWRGdzSJA4umew7wwzENvvWUQLmkHImhRmy1l6SsRt6TIsNtAQ+yWpmTbKdaDGJNvw25mNAqs9LhxMtW/jrokpKXH6L1bql1hRKm2It+77gpCMiGxM093GCwVJCCx6vNtFGh0bcBG2Zcf7Phda+eN0G9fKz1C3XguHRNEuPY0zI1pxirDtGyO3R/85QDatY82fPr6xDMYz1NxavDG9RpbgrHf09YIpVh2mFAdMxIUvjWe74f8/TkJ8SVS5Lhsih4C3ohh7wA/+8ifxR1ZCfV6J1AlX5OF6+UTU9Kl5CbZ5+xbz0K/F5jkSqVf7tVuZDvwUBRGkAnWksIij6U0al7FI8WTvfauJeDVwX1Y8ZofGqJh3nA1ENJ6NCAi7i6sV+9k4idI=" - on: - branch: master - tags: true - # test pypi - - provider: pypi - distributions: sdist bdist_wheel - server: https://test.pypi.org/legacy/ - user: "__token__" - password: - secure: "lg8pH6BfqX/dsQynL7SEzW+zV2yABkI1B1PROEkCa+BX3P+BdKAQw1qhGhz35EB0dPgg10nqf9+wYbBPCMoTWig2KttD9FSNODQQua4/J6CtMr/I7KuuRCIb5yD1DUjMM4eYDt6l6dePxaT8JwjGfaYSweGIOhULaDzmNci95+IihA5KysE1b1RWkagrd3c1g3tztPJEmXHltI+mRdu+uaYksji6zl1z0Xpwwai8Qh40RTClQ0F3hnoUnRlzyIf5ezrVvr4t5XSK60ya6BS0+DvsWuo79d3Q/s1ARPf8EIdcYUpeCraeWRbrQtyc/Gra7pSmW16bd+wlmNdvp4V8G4QZL3jS3TXEg/RhHJ/jCbbsBi2bI+FTr9K0YOggWv+QhnSzwn8F9ZvrL+eKoB/226IWUgC2N1SCaaM6FML3MZLiAg0UixQr1EPYX5w7sl36aIAVr+gUdAoES0RTvt4X7+s2nMKFmaMcUv/r+P40qVcmV5YiNBHwYsgPnjyKQlN1rH3lsNEGG/fTqyh4hRFZNzg/UnHxAaOVhezI1/E/tP45Pj4d/w0AGDoFy9E4CjUqNYvuR6QCGMMLIXjSIrF3Fy/ZmHA1qQ1nAh7QteSxBr8vLTz2BauaPZe4h5os0j47AyX1RFAcMGkTN3thGyaSJsxUJgN668VQcHYJPb5hI7w=" - on: - branch: master - tags: false