-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump version, merge pull request #15 from NiftyPET/dev2
- Loading branch information
Showing
84 changed files
with
5,197 additions
and
6,482 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,50 @@ | ||
name: Comment Bot | ||
on: | ||
issue_comment: | ||
types: [created] | ||
pull_request_review_comment: | ||
types: [created] | ||
jobs: | ||
tag: # /tag <tagname> <commit> | ||
if: startsWith(github.event.comment.body, '/tag ') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: React Seen | ||
uses: actions/github-script@v2 | ||
with: | ||
script: | | ||
const perm = await github.repos.getCollaboratorPermissionLevel({ | ||
owner: context.repo.owner, repo: context.repo.repo, | ||
username: context.payload.comment.user.login}) | ||
post = (context.eventName == "issue_comment" | ||
? github.reactions.createForIssueComment | ||
: github.reactions.createForPullRequestReviewComment) | ||
if (!["admin", "write"].includes(perm.data.permission)){ | ||
post({ | ||
owner: context.repo.owner, repo: context.repo.repo, | ||
comment_id: context.payload.comment.id, content: "laugh"}) | ||
throw "Permission denied for user " + context.payload.comment.user.login | ||
} | ||
post({ | ||
owner: context.repo.owner, repo: context.repo.repo, | ||
comment_id: context.payload.comment.id, content: "eyes"}) | ||
- name: Tag Commit | ||
run: | | ||
git clone https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} repo | ||
git -C repo tag $(echo "$BODY" | awk '{print $2" "$3}') | ||
git -C repo push --tags | ||
rm -rf repo | ||
env: | ||
BODY: ${{ github.event.comment.body }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- name: React Success | ||
uses: actions/github-script@v2 | ||
with: | ||
script: | | ||
post = (context.eventName == "issue_comment" | ||
? github.reactions.createForIssueComment | ||
: github.reactions.createForPullRequestReviewComment) | ||
post({ | ||
owner: context.repo.owner, repo: context.repo.repo, | ||
comment_id: context.payload.comment.id, content: "rocket"}) |
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,81 @@ | ||
name: Test | ||
on: | ||
- push | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.6, 3.9] | ||
name: Check py${{ matrix.python }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: set PYSHA | ||
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- run: pip install -U pre-commit twine setuptools wheel setuptools_scm[toml] ninst scikit-build | ||
- run: HMUDIR=$HOME python setup.py sdist | ||
- run: twine check dist/* | ||
- run: pre-commit run -a --show-diff-on-failure | ||
test: | ||
runs-on: [self-hosted, cuda] | ||
name: Test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- run: pip install -U -e .[dev] | ||
- run: pytest | ||
- run: codecov | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
deploy: | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
needs: [check, test] | ||
name: PyPI Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- run: pip install -U twine setuptools wheel setuptools_scm[toml] ninst scikit-build | ||
- run: HMUDIR=$HOME python setup.py sdist | ||
- run: twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
skip_existing: true | ||
- id: collect_assets | ||
name: Collect assets | ||
run: | | ||
echo "::set-output name=asset_path::$(ls dist/*.tar.gz)" | ||
echo "::set-output name=asset_name::$(basename dist/*.tar.gz)" | ||
git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md | ||
- id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ninst ${{ github.ref }} beta | ||
body_path: _CHANGES.md | ||
draft: true | ||
- uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ steps.collect_assets.outputs.asset_path }} | ||
asset_name: ${{ steps.collect_assets.outputs.asset_name }} | ||
asset_content_type: application/gzip |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
*.py[co] | ||
__pycache__/ | ||
|
||
# build | ||
MANIFEST | ||
*.so | ||
*.png | ||
*.eps | ||
*.log | ||
/docs/ | ||
/niftypet/nipet/cmake/ | ||
/niftypet/nipet/_dist_ver.py | ||
/build/ | ||
/dist/ | ||
/nipet.egg*/ | ||
/output/ | ||
/niftyout/ | ||
.ipynb_checkpoints/ | ||
Makefile | ||
.DS_Store | ||
.gitignore | ||
/_skbuild/ | ||
/_cmake_test_compile/ | ||
/*.egg*/ | ||
/.eggs/ | ||
|
||
/.coverage | ||
/coverage.xml |
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,19 @@ | ||
default_language_version: | ||
python: python3 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- hooks: | ||
- id: isort | ||
repo: https://github.com/timothycrosley/isort | ||
rev: 5.6.4 |
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 was deleted.
Oops, something went wrong.
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.