From 4feb64719e5d20386a9b0db44dda3cffa2816111 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:10:57 +0100 Subject: [PATCH 01/11] Switch to GitHub Actions --- .github/workflows/autorelease-default-env.sh | 5 ++ .github/workflows/autorelease-deploy.yml | 33 ++++++++++ .github/workflows/autorelease-gh-rel.yml | 29 +++++++++ .github/workflows/autorelease-prep.yml | 60 ++++++++++++++++++ .github/workflows/unit-tests.yml | 65 ++++++++++++++++++++ .travis.yml => .travis.yml.disabled | 0 6 files changed, 192 insertions(+) create mode 100644 .github/workflows/autorelease-default-env.sh create mode 100644 .github/workflows/autorelease-deploy.yml create mode 100644 .github/workflows/autorelease-gh-rel.yml create mode 100644 .github/workflows/autorelease-prep.yml create mode 100644 .github/workflows/unit-tests.yml rename .travis.yml => .travis.yml.disabled (100%) diff --git a/.github/workflows/autorelease-default-env.sh b/.github/workflows/autorelease-default-env.sh new file mode 100644 index 0000000..f1da159 --- /dev/null +++ b/.github/workflows/autorelease-default-env.sh @@ -0,0 +1,5 @@ +INSTALL_AUTORELEASE="python -m pip install autorelease==0.2.6" +if [ -f autorelease-env.sh ]; then + source autorelease-env.sh +fi + diff --git a/.github/workflows/autorelease-deploy.yml b/.github/workflows/autorelease-deploy.yml new file mode 100644 index 0000000..9a8f03b --- /dev/null +++ b/.github/workflows/autorelease-deploy.yml @@ -0,0 +1,33 @@ +name: Autorelease +on: + release: + types: [published] + +jobs: + deploy_pypi: + runs-on: ubuntu-latest + name: "Deploy to PyPI" + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - run: | # TODO: move this to an action + source ./.github/workflows/autorelease-default-env.sh + if [ -f "autorelease-env.sh" ]; then + cat autorelease-env.sh >> $GITHUB_ENV + fi + eval $INSTALL_AUTORELEASE + name: "Install autorelease" + - run: | + python -m pip install twine wheel + name: "Install release tools" + - run: | + python setup.py sdist bdist_wheel + twine check dist/* + name: "Build and check package" + - uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} + name: "Deploy to pypi" + diff --git a/.github/workflows/autorelease-gh-rel.yml b/.github/workflows/autorelease-gh-rel.yml new file mode 100644 index 0000000..bb5cd27 --- /dev/null +++ b/.github/workflows/autorelease-gh-rel.yml @@ -0,0 +1,29 @@ +name: Autorelease +on: + push: + branches: + - stable + +jobs: + release-gh: + runs-on: ubuntu-latest + name: "Cut release" + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.7" + - run: | # TODO: move this to an action + source ./.github/workflows/autorelease-default-env.sh + if [ -f "autorelease-env.sh" ]; then + cat autorelease-env.sh >> $GITHUB_ENV + fi + eval $INSTALL_AUTORELEASE + name: "Install autorelease" + - run: | + VERSION=`python setup.py --version` + PROJECT=`python setup.py --name` + echo $PROJECT $VERSION + autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN + env: + AUTORELEASE_TOKEN: ${{ secrets.AUTORELEASE_TOKEN }} diff --git a/.github/workflows/autorelease-prep.yml b/.github/workflows/autorelease-prep.yml new file mode 100644 index 0000000..4967413 --- /dev/null +++ b/.github/workflows/autorelease-prep.yml @@ -0,0 +1,60 @@ +name: "Autorelease" +on: + pull_request: + branches: + - stable + +defaults: + run: + shell: bash + +jobs: + deploy_testpypi: + runs-on: ubuntu-latest + name: "Deployment test" + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - run: | # TODO: move this to an action + source ./.github/workflows/autorelease-default-env.sh + if [ -f "autorelease-env.sh" ]; then + cat autorelease-env.sh >> $GITHUB_ENV + fi + eval $INSTALL_AUTORELEASE + name: "Install autorelease" + - run: | + python -m pip install twine wheel + name: "Install release tools" + - run: | + bump-dev-version + python setup.py --version + name: "Bump testpypi dev version" + - run: | + python setup.py sdist bdist_wheel + twine check dist/* + name: "Build and check package" + - uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.testpypi_password }} + repository_url: https://test.pypi.org/legacy/ + name: "Deploy to testpypi" + test_testpypi: + runs-on: ubuntu-latest + name: "Test deployed" + needs: deploy_testpypi + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - run: | # TODO: move this to an action + source ./.github/workflows/autorelease-default-env.sh + if [ -f "autorelease-env.sh" ]; then + cat autorelease-env.sh >> $GITHUB_ENV + fi + eval $INSTALL_AUTORELEASE + name: "Install autorelease" + - run: test-testpypi + diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..62cd0d0 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,65 @@ +name: "Unit tests" +on: + pull_request: + branches: + - master + - stable + push: + branches: + - master + tags: + - "v*" + schedule: + - cron: "20 5 * * *" + +defaults: + run: + shell: bash -l {0} + +jobs: + test_suite: + runs-on: ubuntu-latest + name: "Unit Tests" + strategy: + matrix: + CONDA_PY: + - 3.9 + - 3.8 + - 3.7 + - 3.6 + CANONICAL_PYTHON: ["3.8"] + MDTRAJ: ["release"] + include: + - CONDA_PY: 3.9 + MDTRAJ: "dev" + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-python: true + python-version: ${{ matrix.CONDA_PY }} + - name: "Install" + env: + MDTRAJ: ${{ matrix.MDTRAJ }} + run: | + source ci/pip-install/install_requirements.sh + pip install -e . + pip install -U -r ci/pip-install/testing_requirements.txt + if [ "$MDTRAJ" = "dev" ]; then + pip install --upgrade --force-reinstall -r ci/pip-install/mdtraj_dev.txt + pip install -r optional_installs.txt + fi + - name: "Versions" + run: pip list + - name: "Autorelease check" + run: python autorelease_check.py + - name: "Tests" + run: | + python -c "import contact_map" + py.test -vv --cov=contact_map --cov-report xml:cov.xml + - name: "Report coverage" + run: | + COVERALLS_PARALLEL=true coveralls + python-codacy-coverage -r cov.xml diff --git a/.travis.yml b/.travis.yml.disabled similarity index 100% rename from .travis.yml rename to .travis.yml.disabled From b27eafbe260629352109e9383dc5e74f523e8f34 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:12:47 +0100 Subject: [PATCH 02/11] fix typo --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 62cd0d0..d28a27c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -58,7 +58,7 @@ jobs: - name: "Tests" run: | python -c "import contact_map" - py.test -vv --cov=contact_map --cov-report xml:cov.xml + py.test -vv --cov=contact_map --cov-report xml:cov.xml - name: "Report coverage" run: | COVERALLS_PARALLEL=true coveralls From 0c1c9d73d6ac04ace1e91d2ab3f248e820103d7a Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:23:53 +0100 Subject: [PATCH 03/11] update autorelease_check.py --- autorelease_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autorelease_check.py b/autorelease_check.py index 9ac0536..5a234ca 100644 --- a/autorelease_check.py +++ b/autorelease_check.py @@ -25,5 +25,5 @@ ) checker.release_branches = RELEASE_BRANCHES + [RELEASE_TAG] - tests = checker.select_tests_from_sysargs() + tests = checker.select_tests() n_fails = checker.run_as_test(tests) From 1829c2f4f43cd18b3f5fc4b8d05daf71bae25ae1 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:35:17 +0100 Subject: [PATCH 04/11] updates to envs in actions --- .github/workflows/unit-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d28a27c..d548a30 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,7 +27,6 @@ jobs: - 3.8 - 3.7 - 3.6 - CANONICAL_PYTHON: ["3.8"] MDTRAJ: ["release"] include: - CONDA_PY: 3.9 @@ -43,6 +42,7 @@ jobs: - name: "Install" env: MDTRAJ: ${{ matrix.MDTRAJ }} + PY_COLORS: "1" run: | source ci/pip-install/install_requirements.sh pip install -e . @@ -60,6 +60,8 @@ jobs: python -c "import contact_map" py.test -vv --cov=contact_map --cov-report xml:cov.xml - name: "Report coverage" + env: + GITHUB_TOKEN = ${{ secrets.GITHUB_TOKEN }} run: | COVERALLS_PARALLEL=true coveralls python-codacy-coverage -r cov.xml From 73f9b491f055bea65d80788738a5052a644a829d Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:40:12 +0100 Subject: [PATCH 05/11] try writing valid yaml --- .github/workflows/unit-tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d548a30..c846fe3 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -42,7 +42,6 @@ jobs: - name: "Install" env: MDTRAJ: ${{ matrix.MDTRAJ }} - PY_COLORS: "1" run: | source ci/pip-install/install_requirements.sh pip install -e . @@ -56,12 +55,14 @@ jobs: - name: "Autorelease check" run: python autorelease_check.py - name: "Tests" + env: + PY_COLORS: "1" run: | python -c "import contact_map" py.test -vv --cov=contact_map --cov-report xml:cov.xml - name: "Report coverage" env: - GITHUB_TOKEN = ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | COVERALLS_PARALLEL=true coveralls python-codacy-coverage -r cov.xml From 059d2c7ced2e220471d9bb7be7d0fea308005607 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:46:48 +0100 Subject: [PATCH 06/11] add codacy project token do we still care about codacy? --- .github/workflows/unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index c846fe3..e22f82d 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -63,6 +63,7 @@ jobs: - name: "Report coverage" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} run: | COVERALLS_PARALLEL=true coveralls python-codacy-coverage -r cov.xml From ece1c5195ccc9ef9ad784e85587cfc35cdff0075 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Dec 2020 10:51:58 +0100 Subject: [PATCH 07/11] badge; drop codacy coverage --- .github/workflows/unit-tests.yml | 2 -- README.md | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index e22f82d..70a9e2a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -63,7 +63,5 @@ jobs: - name: "Report coverage" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} run: | COVERALLS_PARALLEL=true coveralls - python-codacy-coverage -r cov.xml diff --git a/README.md b/README.md index c5d012c..7206892 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ [![Documentation Status](https://readthedocs.org/projects/contact-map/badge/?version=latest)](http://contact-map.readthedocs.io/en/latest/?badge=latest) -[![Linux Build Status](https://travis-ci.org/dwhswenson/contact_map.svg?branch=master)](https://travis-ci.org/dwhswenson/contact_map) +![Unit tests](https://github.com/dwhswenson/contact_map/workflows/Unit%20tests/badge.svg) [![Windows Build status](https://ci.appveyor.com/api/projects/status/em3fo96sjrg2vmcc/branch/master?svg=true)](https://ci.appveyor.com/project/dwhswenson/contact-map/branch/master) [![Coverage Status](https://coveralls.io/repos/github/dwhswenson/contact_map/badge.svg?branch=master)](https://coveralls.io/github/dwhswenson/contact_map?branch=master) [![PyPI](https://img.shields.io/pypi/v/contact-map.svg)](https://pypi.python.org/pypi/contact-map/) [![conda-forge](https://img.shields.io/conda/v/conda-forge/contact_map.svg)](https://github.com/conda-forge/contact_map-feedstock) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dwhswenson/contact_map/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f7f3cf53698e4655ac8895f13fa5dea6)](https://www.codacy.com/app/dwhswenson/contact_map?utm_source=github.com&utm_medium=referral&utm_content=dwhswenson/contact_map&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/84768756d594176d8da6/maintainability)](https://codeclimate.com/github/dwhswenson/contact_map/maintainability) -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dwhswenson/contact_map/master) # Contact Map Explorer This package provides tools for analyzing and exploring contacts From f4052b87ac5849034839b80f1cdc669da91942c8 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 21 Dec 2020 10:44:34 +0100 Subject: [PATCH 08/11] switch to codecov --- .github/workflows/unit-tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a817640..0c703cb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -61,6 +61,4 @@ jobs: python -c "import contact_map" py.test -vv --cov=contact_map --cov-report xml:cov.xml - name: "Report coverage" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: COVERALLS_PARALLEL=true coveralls + uses: codecov/codecov-action@v1 From cd534fb3c0e6a53283a0e53d09d94b2c80c0b95f Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 21 Dec 2020 10:48:50 +0100 Subject: [PATCH 09/11] Clean up actions; use default coverage name --- .github/workflows/unit-tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0c703cb..0cfe6d2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,10 +27,10 @@ jobs: - 3.8 - 3.7 - 3.6 - MDTRAJ: ["release"] + MDTRAJ: ["mdtraj-rel"] include: - CONDA_PY: 3.9 - MDTRAJ: "dev" + MDTRAJ: "mdtraj-dev" steps: - uses: actions/checkout@v2 @@ -46,7 +46,7 @@ jobs: source ci/pip-install/install_requirements.sh pip install -e . pip install -U -r ci/pip-install/testing_requirements.txt - if [ "$MDTRAJ" = "dev" ]; then + if [ "$MDTRAJ" = "mdtraj-dev" ]; then pip install --upgrade --force-reinstall -r ci/pip-install/mdtraj_dev.txt pip install -r optional_installs.txt fi @@ -59,6 +59,7 @@ jobs: PY_COLORS: "1" run: | python -c "import contact_map" - py.test -vv --cov=contact_map --cov-report xml:cov.xml + py.test -vv --cov=contact_map --cov-report xml - name: "Report coverage" + if: ${{ github.event }} != "schedule" uses: codecov/codecov-action@v1 From 6fb4ef3970a1938151aea0cae1bcc83ccb23e346 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 21 Dec 2020 11:10:20 +0100 Subject: [PATCH 10/11] switch to codecov script, not action --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0cfe6d2..4439db7 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -62,4 +62,4 @@ jobs: py.test -vv --cov=contact_map --cov-report xml - name: "Report coverage" if: ${{ github.event }} != "schedule" - uses: codecov/codecov-action@v1 + run: bash <(curl -s https://codecov.io/bash) From 03324213550db9420c5805346859330409fb2480 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 21 Dec 2020 11:19:48 +0100 Subject: [PATCH 11/11] add codecov badge --- .github/workflows/unit-tests.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 4439db7..05d9d68 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,7 +27,7 @@ jobs: - 3.8 - 3.7 - 3.6 - MDTRAJ: ["mdtraj-rel"] + MDTRAJ: ["mdtraj-release"] include: - CONDA_PY: 3.9 MDTRAJ: "mdtraj-dev" diff --git a/README.md b/README.md index 7206892..19200ec 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Documentation Status](https://readthedocs.org/projects/contact-map/badge/?version=latest)](http://contact-map.readthedocs.io/en/latest/?badge=latest) ![Unit tests](https://github.com/dwhswenson/contact_map/workflows/Unit%20tests/badge.svg) [![Windows Build status](https://ci.appveyor.com/api/projects/status/em3fo96sjrg2vmcc/branch/master?svg=true)](https://ci.appveyor.com/project/dwhswenson/contact-map/branch/master) -[![Coverage Status](https://coveralls.io/repos/github/dwhswenson/contact_map/badge.svg?branch=master)](https://coveralls.io/github/dwhswenson/contact_map?branch=master) +[![codecov](https://codecov.io/gh/dwhswenson/contact_map/branch/master/graph/badge.svg?token=4so8QmiC5W)](https://codecov.io/gh/dwhswenson/contact_map) [![PyPI](https://img.shields.io/pypi/v/contact-map.svg)](https://pypi.python.org/pypi/contact-map/) [![conda-forge](https://img.shields.io/conda/v/conda-forge/contact_map.svg)](https://github.com/conda-forge/contact_map-feedstock)