From b48e6a62e6d2bdc74bfb4ecdc301491c1daa666f Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 16:59:30 +0100 Subject: [PATCH 1/8] Migrate to workflow --- .github/workflows/build.yaml | 42 ++++++++++++++++++++++++++++++++++++ .travis.yml | 33 ---------------------------- 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..aeeecd0 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,42 @@ +name: Python Package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.5, 3.6, 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 + - name: Publish to PyPI + if: 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 \ 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= From 3a24870629ddbc784b68056e72fdd7ee5d343ced Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:02:57 +0100 Subject: [PATCH 2/8] Fix --- .github/workflows/{build.yaml => build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build.yaml => build.yml} (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yaml rename to .github/workflows/build.yml From 277cad5c8780a44061b037c6b3232b8321606f21 Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:09:21 +0100 Subject: [PATCH 3/8] Run script on all branches and don't publish unless on master --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aeeecd0..08eadd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Python Package on: push: - branches: [ master ] + branches: [ "*" ] pull_request: - branches: [ master ] + branches: [ "*" ] jobs: @@ -34,7 +34,7 @@ jobs: coverage report coveralls - name: Publish to PyPI - if: github.event_name == 'push' && matrix.python-version == '3.10' + if: github.ref == 'master' && github.event_name == 'push' && matrix.python-version == '3.10' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ From 6b6359fabdf4bfff6c3788270c3f0865a2c290d3 Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:12:09 +0100 Subject: [PATCH 4/8] Fix where to build --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08eadd2..77fcff4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Python Package on: push: - branches: [ "*" ] + branches: [ "**" ] pull_request: - branches: [ "*" ] + branches: [ "**" ] jobs: From ed7f9e038284a94289e22af04683262a3bb3f62d Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:14:25 +0100 Subject: [PATCH 5/8] Fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77fcff4..faac123 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11] + python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 From edf600b7435aa6f2e6e36ff5944571e9a5568bc4 Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:16:09 +0100 Subject: [PATCH 6/8] Fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index faac123..b6c6434 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 From f264524559c14cc82067bdbfdeabd8854e44482d Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:18:11 +0100 Subject: [PATCH 7/8] Fix --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6c6434..74b814b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,8 @@ jobs: run: | coverage report coveralls + env: | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - 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 From 9a6b3f12d06a765eaeee7336828fb330ddba2d93 Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 30 Oct 2024 17:20:58 +0100 Subject: [PATCH 8/8] Fix --- .github/workflows/build.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74b814b..d2864b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,12 +33,28 @@ jobs: run: | coverage report coveralls - env: | + 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 \ No newline at end of file + 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