From b83d8be43cd3b4b46106854ad9984dec58f4bae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=BCndler?= Date: Wed, 30 Oct 2024 17:22:38 +0100 Subject: [PATCH] Migrate to Github workflow (#45) * Migrate to workflow * Fix * Run script on all branches and don't publish unless on master * Fix where to build * Fix * Fix * Fix * Fix --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++++++++ .travis.yml | 33 -------------------- 2 files changed, 60 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d2864b3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Python Package + +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "**" ] + +jobs: + + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + 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 dependencies + run: | + if [[ ${{ matrix.python-version }} == 3.7 ]]; then + pip install -U importlib_metadata + fi + pip install coverage coveralls + pip install -e . + - name: Run tests + run: coverage run --source=pyblnet setup.py test + - name: Coverage report + run: | + coverage report + coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.python-version }} + COVERALLS_PARALLEL: true + - name: Publish to PyPI + if: github.ref == 'master' && github.event_name == 'push' && matrix.python-version == '3.10' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + skip_existing: true + + + coveralls: + name: Indicate completion to coveralls.io + needs: build + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Install coveralls + run: pip3 install --upgrade coveralls + - name: Finished + run: coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2a6fadb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: python -python: -- '3.5' -- '3.6' -- '3.7' -- '3.8' -- '3.9' -- '3.10' -- '3.11' -dist: bionic -sudo: true -matrix: - fast_finish: true -install: -- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pip install -U importlib_metadata; - fi -- pip install coverage coveralls -- pip install -e . -script: -- coverage run --source=pyblnet setup.py test -after_success: -- coverage report -- coveralls -deploy: - provider: pypi - on: - branch: master - python: '3.10' - distributions: sdist bdist_wheel - skip_existing: true - username: "__token__" - password: - secure: byFAB9BEESb6x25aDAVH9vL3E3/qxCzsuKJ9eO8Aabj/5kTIccO5aoEDOsFChQvrRGtiBmy1Q6MUSyh0ifU1iyW+1dswTKJOJaMfhmbm0VtWOuQytDronhH+9rCRsOVXui2vT4eRuXRPGR4F1FtzaiuphpgZLZ1kGx5FQmdWYnIArQeSbra0i6+fnBr4qJrMjNUTwJWyFpdzHcPdaLy+NB6/LVHpbhyJmC9+oW217/Oq0II2h67gUHWR+cI/lHB853kvuSQrRs3XENSfMTGl4oX68N4zDQqbadRzdKzBGpVax9Klue4c9rlhoxAHS/NyjWSixMci/bzhkTYWURU8y4I/4VsZ1xwFQq3ev0wSYUmSsGVlnpqNR1UtJ5qdqP/k251MPOPtQwKSSKA4EOztmP1csM+OGLfvBAm8JRfRK6QanjjfHH8H6oLDmyRGwEGEoMUahIhydlsQAgWht3qYVU23aetGqAOgO87xsA826ZiZKTKlA1veCk10U77YKgg48pv4v0dQ7lS+0rgFyT81SFKvqS82uIQfd0H6QCQ8f8q9NTQofro/21eUjjhKPys0TKOBRIYAQN2pJYjF0E7uNqwIGZqxLqw/MdteEVYJr6dsdV9Sh015WFZIvuVxERr0uHsAbjVD1rDQM5OfIwgRTSOG63u+qRhFXyk5G8jbuzo=