-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds gh workflows. Also refactors optional dependencies to tests and dev.
- Loading branch information
Showing
11 changed files
with
346 additions
and
50 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,28 @@ | ||
name-template: 'v$NEXT_PATCH_VERSION 🧮' | ||
tag-template: '$NEXT_PATCH_VERSION' | ||
categories: | ||
- title: 'New Features' | ||
label: 'enhancement' | ||
- title: 'Deprecation' | ||
label: 'deprecation' | ||
- title: 'Bug Fixes' | ||
labels: | ||
- 'bug' | ||
- 'Fix' | ||
- title: 'Documentation' | ||
label: 'documentation' | ||
- title: 'Maintenance' | ||
labels: | ||
- 'maintenance' | ||
- 'dependencies' | ||
- 'github_actions' | ||
- title: 'Testing' | ||
label: 'tests' | ||
- title: 'Under the Bonnet' | ||
label: 'code improvement' | ||
- title: 'Continuous Integration' | ||
label: 'CI' | ||
template: | | ||
# What's Changed | ||
$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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build and test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-black: | ||
# fail it if doesn't conform to black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable | ||
with: | ||
options: "--check --verbose" | ||
|
||
build-and-test: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: 'requirements_tests.txt' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements_tests.txt | ||
pip install -e . | ||
- name: Lint with flake8 | ||
# fail it if doesn't pass flake8 | ||
run: | | ||
flake8 . --statistics | ||
- name: Test with pytest | ||
# fail it if doesn't pass test suite | ||
run: | | ||
pytest |
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,16 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Updates next release notes on any push to main. Label a PR to categorize it | ||
# in accordance with .github/release_drafter.yml. | ||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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,63 @@ | ||
# Workflow to upload a Python Package using Twine when a release is created | ||
name: Release to PyPI | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TEST_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Install from testpypi and import | ||
run: | | ||
i=0 | ||
while (($i<12)) && [ "${{ github.ref_name }}" != $(pip index versions -i https://test.pypi.org/simple --pre beanahead | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\ | ||
do echo waiting for package to appear in test index, sleeping 5s; sleep 5s; let i++; done | ||
pip install --index-url https://test.pypi.org/simple beanahead==${{ github.ref_name }} --no-deps | ||
pip install -r requirements.txt | ||
python -c 'import beanahead;print(beanahead.__version__)' | ||
- name: Clean pip | ||
run: | | ||
pip uninstall -y beanahead | ||
pip cache purge | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Install and import | ||
run: | | ||
i=0 | ||
while (($i<12)) && [ "${{ github.ref_name }}" != $(pip index versions -i https://pypi.org/simple --pre beanahead | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\ | ||
do echo waiting for package to appear in index, sleeping 5s; sleep 5s; let i++; done | ||
pip install --index-url https://pypi.org/simple beanahead==${{ github.ref_name }} | ||
python -c 'import beanahead;print(beanahead.__version__)' |
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
Oops, something went wrong.