-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from dwhswenson/github-actions
Switch to GitHub Actions and CodeCov
- Loading branch information
Showing
8 changed files
with
196 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
MDTRAJ: ["mdtraj-release"] | ||
include: | ||
- CONDA_PY: 3.9 | ||
MDTRAJ: "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" = "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" | ||
env: | ||
PY_COLORS: "1" | ||
run: | | ||
python -c "import contact_map" | ||
py.test -vv --cov=contact_map --cov-report xml | ||
- name: "Report coverage" | ||
if: ${{ github.event }} != "schedule" | ||
run: bash <(curl -s https://codecov.io/bash) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters